Elements

MDX and Keystatic Components

Get this template

Isn't this the cutest little dog ever? This adorable image comes with the template at no extra cost :)

Newsletter CTA

This component is also auto-imported in all mdx files. You can use it like:

<Newsletter />

Become an insider

Join the newsletter and be first to hear about new articles, tips, and more!

Admonition

Also sometimes called a “Callout”. Useful to break up a block of text and provide some extra tidbit of info. You can use it like:

<Admonition variant="info">Your text here</Admonition>

TIP

Admonition variant="tip". Use this to provide a cool tip.

CAUTION

Admonition variant="caution". Use this to warn people of potential issues.

DANGER

Admonition variant="danger". Use this to tell people not to do something.

INFO

Admonition variant="info". Use this to provide extra secret sauce.


Other Markdown Elements

Headings

Here is an example of headings. You can use this heading by the following markdown rules. For example: use # for heading 1 and use ###### for heading 6.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Emphasis

The emphasis, aka italics, with asterisks or underscores.

Strong emphasis, aka bold, with asterisks or underscores.

The combined emphasis with asterisks and ***underscores***.

Strikethrough uses two tildes. Scratch this.


I’m an inline-style link

I’m an inline-style link with title

I’m a reference-style link

You can use numbers for reference-style link definitions

Or leave it empty and use the link text itself.

example.com (but not on Github, for example).

Some text to show that the reference links can follow later.


Paragraph

Lorem ipsum dolor sit amet consectetur adipisicing elit. Quam nihil enim maxime corporis cumque totam aliquid nam sint inventore optio modi neque laborum officiis necessitatibus, facilis placeat pariatur! Voluptatem, sed harum pariatur adipisci voluptates voluptatum cumque, porro sint minima similique magni perferendis fuga! Optio vel ipsum excepturi tempore reiciendis id quidem? Vel in, doloribus debitis nesciunt fugit sequi magnam accusantium modi neque quis, vitae velit, pariatur harum autem a! Velit impedit atque maiores animi possimus asperiores natus repellendus excepturi sint architecto eligendi non, omnis nihil. Facilis, doloremque illum. Fugit optio laborum minus debitis natus illo perspiciatis corporis voluptatum rerum laboriosam.


Ordered List

  1. List item

  2. List item

  3. List item

  4. List item

  5. List item


Unordered List

  • List item

  • List item

  • List item

  • List item

  • List item


Code and Syntax Highlighting

This is an Inline code sample.

Below are code block samples, showing the custom Shiki highlighting configuration.

export async function getAllPosts(): Promise<CollectionEntry<"blog">[]> {
  const posts = await getCollection("blog", ({ data }) => {
    // filter out draft posts
    return data.draft !== true;
  });

  // filter out future posts and sort by date
  const formattedPosts: CollectionEntry<"blog">[] = formatPosts(posts, {
    filterOutFuturePosts: true,
    sortByDate: true,
    limit: undefined,
  });

  return formattedPosts;
}
s = "Python syntax highlighting"
print s
---
import { getEntryBySlug } from "astro:content";

// layout
import BlogLayout from "@layouts/BlogLayoutLeft.astro";

const post = await getEntryBySlug("blog", "tsconfig-paths-setup");

const { Content } = await post.render();
---

<BlogLayout post={post} templateLiteralNameAttribute={`MyNameIs${name}`}>
  <Content />
</BlogLayout>

Blockquote

This is a blockquote example.


Tables

MarkdownLessPretty
Stillrendersnicely
123

There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don’t need to make the raw Markdown line up prettily. You can also use inline Markdown.