A simple introduction to writing blog posts with MDX and server-rendered syntax highlighting
Welcome to MDX
This is your first MDX blog post. MDX allows you to use JSX components directly in your markdown content, making it perfect for technical writing.
Code Examples
Here's some TypeScript code with syntax highlighting powered by Shiki (running on the server):
And here's a React component:
The code highlighting works in both light and dark mode automatically!
Using Custom Components
ℹ️
This callout component is defined in mdx-components.tsx and can be used anywhere in your MDX content!
⚠️
You can create any custom components you need - charts, interactive demos, embeds, and more.
Why MDX?
- Write in Markdown - Familiar syntax for content
- Use React Components - Embed interactive elements
- Server-Rendered - Code highlighting happens at build time
- Type-Safe - Full TypeScript support
What's Next?
You can add more custom components to mdx-components.tsx:
Then use it in your MDX:
Happy writing!