mdxblogdemo
MDX Kitchen Sink
A tour of the MDX blog features: headings, code, images, tables, diagrams, and links.
F0RR02 min read209 wordsUpdated Feb 10, 2025
Table of contents
Quickstart
Create a folder, add page.mdx, and drop assets next to it.
src/content/blog/my-post/page.mdxsrc/content/blog/my-post/opengraph-image.png- Add
opengraph-image.pngnext to the post
Tip: keep
draft: trueuntil you are ready to publish.
Code blocks
Use fenced blocks with a language for syntax highlighting.
type Post = {
title: string;
date: string;
};
const posts: Post[] = [
{ title: "Hello", date: "2025-01-01" },
];Inline code like next.config.ts is styled too.
Images
Markdown images work with relative paths:

You can also use the MDX <Image /> component for optimized images:
Tables
GFM tables are enabled:
| Feature | Support |
|---|---|
| GFM tables | Yes |
| Syntax highlighting | Yes |
| Mermaid diagrams | Yes |
Mermaid diagrams
Use mermaid fenced blocks for diagrams:
flowchart LR
Idea --> Sketch --> Prototype --> Ship
Links
Internal links stay client-side: Blog index
External links open in a new tab: Next.js
Footnotes
Here is a footnote reference.1
Footnotes
-
Footnotes are provided by
remark-gfm. ↩