Back to blog

Getting Started with Next.js and MDX

  • nextjs
  • mdx
  • webdev

Why Next.js + MDX?

I wanted a simple, fast blog that lets me write in Markdown but still use React components when needed. Next.js with MDX is the perfect combo for this.

The Setup

The blog system is file-based — each post is an .mdx file in the content/blog directory with frontmatter for metadata:

---
title: "My Post Title"
description: "A short description"
date: "2026-02-15"
tags: ["tag1", "tag2"]
---

What I Like About This Approach

  • Simple — just write Markdown files, no CMS needed
  • Fast — static generation at build time
  • Flexible — can embed React components in posts
  • Version controlled — posts live in the repo alongside code

What's Next

I plan to add syntax highlighting, reading time estimates, and maybe an RSS feed. But for now, this simple setup works great.

The best blog setup is the one that gets you writing.

Thanks for reading!