2026-05-01

Shipping the simplest blog that works

I almost added gray-matter today.

The plan was the obvious one: drop YAML frontmatter at the top of each .mdx file, parse it with gray-matter in lib/posts.ts, and call it done. Then I read the actual Next.js 16 MDX guide bundled in node_modules/next/dist/docs/ and saw this:

@next/mdx does not support frontmatter by default… @next/mdx does allow you to use exports like any other JavaScript component.

So instead of YAML, each post starts with:

export const metadata = {
  title: "...",
  date: "...",
  description: "...",
};

The listing page imports the MDX module and reads metadata directly. No parser. No new dependency. The "frontmatter" is just a JS object the bundler already knows how to ship.

Why this is better than YAML frontmatter

The lesson

The shortest path to a working blog wasn't the path I learned on other projects. It was the path the framework already supported. Reading the bundled docs first — before reaching for a familiar library — saved a dependency and a chunk of code.

The simplest blog that works is the one that uses what's already in the box.