Modern React projects want speed (static output), flexibility (rich components), and author-friendly content (plain text Markdown).
Next.js 15 delivers all three: its App Router produces SEO-ready pages, and MDX lets each post mix prose with interactive React. Follow this guide and launch a production-ready blog in an afternoon.
1 · Prerequisites
Tool | Version (June 2025) | Why you need it |
---|---|---|
Node.js | ≥ 18 LTS | Edge runtime & native fetch |
pnpm / npm / Yarn | latest | package manager |
Git | any | version control & Vercel deploy |
Basic Markdown | — | write posts |
2 · Project Bootstrap
You now have a React 19 + Turbopack dev server with fast HMR.
3 · Add MDX Support
Next.js 15 can directly treat .mdx
as a page, or you can load content from files and render anywhere. We’ll combine both approaches:
Create an MDX config (next.config.mjs
):
The official guide shows how MDX pages behave like any other route in App Router. nextjs.org
4 · Create Your Post Directory
Each file begins with front-matter:
gray-matter
will extract that YAML block for listing pages.
This pattern is proven by the classic Markdown blog tutorial (Pages Router) and still works after migrating to App Router. nextjs.orgsinglehanded.dev
5 · Dynamic Routes for Blog Posts
Create a folder app/(blog)/posts/[slug]/page.tsx
:
What’s happening
-
generateStaticParams()
replaces the oldgetStaticPaths
and runs at build. -
The page itself is a React Server Component—no client JS cost.
-
revalidate
enables Incremental Static Regeneration. hire-tim.comcoffey.codes
6 · Listing All Posts on /
app/page.tsx
:
7 · Styling & Components
-
Tailwind CSS: already installed; extend typography via
@tailwindcss/typography
. -
Custom MDX components: create
mdx-components.tsx
and pass toMDXRemote
so authors can drop in<YouTube id="xyz" />
right inside Markdown. nextjs.org -
Code highlighting:
rehype-prism-plus
in the MDX config adds Prism themes automatically.
8 · Live Authoring Workflow
-
Add a
.mdx
file undercontent/posts
. -
Save—Turbopack hot-reloads the preview in < 200 ms.
-
Push to GitHub; Vercel build caches unchanged posts and ships a new URL in ±10 s.
Articles written this month show real-world performance: a lightweight MDX blog on Next.js 15 deploys in seconds and hits 100/100 Lighthouse on mobile. mdxblog.io
9 · Deploying to Production
-
Edge Network caches each prerendered page worldwide.
-
Using ISR, edits go live without a full rebuild—ideal for frequent blogging.
Self-hosting? Run next start
behind Nginx or Docker.
10 · Bonus Improvements
Feature | How |
---|---|
RSS feed | Generate XML in a cron-style Server Action each day. |
Search | Fuse.js in the client or Algolia if content grows. |
Analytics | Vercel Analytics or Plausible script in layout.tsx . |
Images | Store in /public/images and use <Image> for optimized formats. |
11 · Wrapping Up
You’ve:
-
Bootstrapped a Next.js 15 project.
-
Added MDX for rich Markdown writing.
-
Created dynamic routes with App Router’s
generateStaticParams
. -
Styled with Tailwind & Prism.
-
Deployed globally with ISR.
That’s a production-grade, component-enhanced blog entirely in React—no headless CMS or plugin maze required.
Next steps: hook up a comments provider (Giscus, Clerk), explore the new explicit caching API, or migrate old Markdown posts by dropping them into /content/posts
. Happy blogging! 🚀