Building a Personal Blog with Next.js and Markdown
·2 min read·
nextjsreactwebdev
Having a personal blog is one of the best ways to share knowledge and build your online presence. In this post, I'll walk through how this very blog was built.
The Stack
- Next.js — React framework with static generation
- Tailwind CSS — Utility-first CSS framework
- Markdown — Write posts in plain
.mdfiles - gray-matter — Parse frontmatter metadata
- remark / rehype — Markdown to HTML pipeline
- highlight.js — Syntax highlighting for code blocks
How It Works
Each blog post is a Markdown file in the content/posts/ directory:
content/
posts/
my-first-post.md
another-post.md
Each file has frontmatter at the top:
---
title: "My Post Title"
date: "2026-04-25"
description: "A brief description"
tags: ["tag1", "tag2"]
---
Your content here...
Rendering Pipeline
The markdown goes through a processing pipeline:
- gray-matter extracts frontmatter and content
- remark-parse parses the markdown AST
- remark-gfm adds GitHub Flavored Markdown support
- remark-rehype converts to HTML AST
- rehype-highlight adds syntax highlighting
- rehype-stringify converts to HTML string
Deployment
The blog is deployed on Vercel with automatic deployments on every push to main. Custom domains are configured through the Vercel dashboard.
Writing New Posts
To write a new post:
- Create a new
.mdfile incontent/posts/ - Add frontmatter with title, date, description, and tags
- Write your content in Markdown
- The blog automatically picks it up — no configuration needed
That's it! Simple, fast, and focused on writing.