SaaS Template
Blog

© 2026 SaaS Template. All rights reserved.

PrivacyCookiesTerms
Back to blog

Building a Blog with Content Collections

How content-collections turns a folder of MDX files into typed data — and why that's a nicer DX than stringly-typed frontmatter.

by Admin
2026-08-26
1 min read
Tags
  • engineering
  • template
  • content-collections

Content Collections

content-collections reads every .mdx file in a directory, validates the frontmatter against a Zod schema, and exposes the result as typed imports.

What you write

---
title: My Post
date: 2026-08-26
tags: [engineering]
author: admin
---

What you get

A fully-typed Post object: post.title, post.date, post.tags, plus the compiled mdxCode. IDE autocomplete included.

Why it beats stringly-typed frontmatter

No more post.frontmatter.title chains or runtime crashes when a field is missing.

PreviousShipping Staging-First Changed How We Review CodeNextReusable UI Tokens, Not Reusable UI

Related reading

designengineering
Reusable UI Tokens, Not Reusable UI
Why centralizing design tokens beats centralizing components — and what that changes about how you ship features.
by Admin
2026-09-02·1 min read
engineeringprocess
Shipping Staging-First Changed How We Review Code
Notes from running a staging integration branch in front of main for a quarter — what worked, what didn't, what we'd change.
by Admin
2026-08-19·1 min read
templategetting-started
Getting Started with Your New SaaS Template
A quick tour of what this template gives you out of the box — and how to make it yours.
by Admin
2026-07-03·1 min read