Markdown Basics
Body text
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Headings
The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.
The quick brown fox jumped over the lazy dog.
Headings appear in the Table of Contents for that blog post.
Formatting
This text is bold. This text is italic. Note: Markdown reserves underlining for links, so you can’t underline text otherwise.
Blockquotes
This is a blockquote.
This is a nested blockquote.
Lists
Unordered Lists
- Unordered list items…
- …can be made with (*)
- …or with (-)
- But don’t mix and match in the same list.
Ordered Lists
- 1st ordered list item
- 2nd ordered list item
- 3rd ordered list item
Links
Markdown supports links, too.
Rich Markdown Content
Code
Code can be written inline, i.e. getState(), or in blocks, where you can (with MDX) do any of the following;
- Declare a language used, to provide color to the code
- Collapse verbose lines of code, allowing them to be made visible with a click of a button
- (Optionally) show line numbers
- Highlight certain important line(s) of code
- And more!
import { getCollection, type CollectionEntry } from 'astro:content'
export async function getAllPosts(): Promise<CollectionEntry<'blog'>[]> {4 collapsed lines
const posts = await getCollection('blog') return posts .filter((post) => !post.data.draft) .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())}Math
Much like code, math can also be written inline; , or in blocks:
Images
You can embed images in Markdown:

Videos
I do not recommend adding video files to the source tree (or in Markdown) due to their sheer size. Instead, I recommend using YouTube or a similar hosting service. YouTube videos can be embedded by copying the HTML embed code directly into the MDX file. If given width and height parameters in your <iframe>, replace them with class="w-full aspect-video" to ensure they do not overflow on small screens.
MDX Components
Callouts
Place these at the top of the MDX file:
import Callout from '@/components/Callout.astro'import { Icon } from 'astro-icon/components'Then, use the <Callout> tag:
Important (An important callout)
Look! This text is inside a callout! You can do ordinary Markdown stuff, like math…
…or code…
import csvimport hashlibimport randomimport shutilimport subprocessimport timeimport uuidfrom pathlib import PathSeveral types of callouts exist. These include, but are not limited to:
| Variant | Usage |
|---|---|
| Note | For general information or comments that don’t fit other categories |
| Tip | For helpful advice or shortcuts related to the topic at hand |
| Warning | For potential pitfalls or common misconceptions |
| Danger | For things that could potentially be destructive or harmful |
| Important | For things that are important to the reader’s understanding |
A full list of these callouts can be seen in the Callout.astro file.
Keyboard Keys
You can add keyboard keys that look like real keys using the <kbd> tag. For example, Ctrl+Alt+Del.