Engineeringnajam.pk
Content as code
Engineering·1 min read
Content as code
Why I keep my blog in MDX files instead of a headless CMS.
nextjs
mdx
writing
For a solo site, a CMS is usually more machinery than you need. Here's why I keep everything in plain MDX files.
Versioned by default
Every post lives in git. I get history, diffs, and backups for free — no separate export step, no vendor to migrate away from.
Components in prose
Because it's MDX, I can drop a React component right into a paragraph:
<Callout>This is a real component, rendered inline.</Callout>Still publishable from anywhere
The one tradeoff — publishing means a commit — I solved with a small API route that commits a post for me. Best of both worlds.