Writing posts in MDX
Nov 6, 2026 · Ada
mdxcontent
Every post on this blog is an MDX file in apps/web/content/blog. MDX is Markdown that can also render React components, so posts get rich formatting without leaving the editor.
Text formatting
You can write bold, italic, strikethrough and inline code, and link to other pages or external sites.
Blockquotes work too. Use them for asides or quotes.
Lists
- Create
content/blog/<slug>/en.mdxandnl.mdx. - Export a
metadataobject with a title and excerpt. - Register the post in
content/blog/index.ts.
- Tables, task lists and strikethrough (via
remark-gfm) - Heading anchors (via
rehype-slug): hover a heading to see its link - Syntax highlighting (a good next step)
Code
import { lang } from "next/root-params"
export default async function Page() {
const locale = await lang()
return <p>Current locale: {locale}</p>
}
Tables
| Feature | Plugin | Turbopack |
|---|---|---|
| GFM tables | remark-gfm | Yes |
| Heading IDs | rehype-slug | Yes |
| Custom JSX | none needed | Yes |
Components
Components from mdx-components.tsx are available in every post without an import:
Callouts
Use <Callout> for tips, notes and warnings. It renders the shadcn/ui Alert.
Plugins must be strings
Turbopack can't receive JavaScript functions from next.config.ts, so remark and rehype plugins are listed by name.