Building Static Sites with Next.js and Markdown

Published on 4/11/2025 β€’ Categories: react, ssg, markdown, nextjs

Building Static Sites with Next.js and Markdown

Next.jsNext.js

Next.js is the ultimate toolkit for building modern static sites with dynamic power.

✍️ Markdown + MDX

Use next-mdx-remote or contentlayer to render blog content from markdown:

tsx
import { MDXRemote } from 'next-mdx-remote';
export default function Post({ source }) {
return <MDXRemote {...source} />;
}

πŸ“ Recommended Folder Structure

/content
  /posts
    hello-world.mdx
/pages
  /blog
    [slug].tsx

🌎 Deploy to Vercel

bash
git push origin main
# Auto-deploy to your-domain.vercel.app

Next.js lets you start static and scale to dynamic β€” all in one framework.

β€œStatic first, dynamic as needed.” β€” Guillermo Rauch