Why I Rebuilt My Portfolio
After years of maintaining a Sanity-backed portfolio, I decided to simplify the stack. The goal was to reduce external dependencies, cut build times, and own my content as plain text files in git.
The result? A blazing fast portfolio where adding a new blog post is just creating an .mdx file.
The Stack
- Next.js 14 (App Router)
- TypeScript for type safety across the board
- Tailwind CSS for utility-first styling
- MDX for rich content with embedded React components
- gray-matter for frontmatter parsing
Setting Up the MDX Pipeline
The MDX pipeline with @next/mdx is straightforward. Here's the next.config.mjs:
Reading Blog Posts
Instead of a CMS query, we read files directly from the filesystem at build time:
The Result
Build times dropped from ~8 seconds (Sanity fetch + compile) to ~2 seconds. Zero network requests at build time. Content lives in git alongside the code — PRs, diffs, rollbacks all work naturally.
This is the first post in the new system. More content coming soon.
