A content site needs a way to go from "I wrote something" to "it's live." The reflex is to reach for a CMS — a database, an admin UI, a content API. For a solo builder writing in a code repo already, that's backwards. The leaner, more durable answer is git as the CMS: content is markdown files, publishing is a commit, and the build turns both into a fast static site. This chapter is the architecture, how to model content so the structure lives in code, and the one tradeoff you're accepting.
The pipeline, end to end
Every box here is something you already have or want anyway. No database to run, no admin to secure, no content API to rate-limit. The "CMS" is your editor plus git. The source of truth is plain text you can grep, diff, branch, and revert — and that an AI can read and write natively, which matters a lot when AI agents are part of the workflow.
Git as CMS: what you trade, what you gain
You give up: a web editing UI, non-technical authoring, and instant publish-without-deploy. You get: version history for free, no infrastructure to run or secure, content that travels with the code, trivial backups (it's a git repo), zero vendor lock-in, and a content store that's just files. For one technical author, that trade is lopsided in git's favor. The moment you have non-technical writers or need live editing, revisit it — but don't pay that complexity before you need it.
Modeling content so structure lives in code
The one design decision that pays off: keep the structure (what series exist, what order chapters go in, what's published) in typed code, and keep the prose in markdown. Don't scatter ordering and navigation into filenames or a database.
A clean split:
- A registry in code — the list of series, their chapters, titles, and order. This drives navigation and the table of contents. It's typed, so a missing or misnamed entry is a build error, not a broken link discovered in production.
- Markdown files for content — one file per chapter, with frontmatter carrying the per-piece metadata.
A frontmatter contract worth copying:
---
title: "..."
description: "..." # also the meta description / OG
order: 2 # position within its part
publishedAt: "2026-06-08"
published: false # the draft switch — see below
---
The cross-check matters: because the registry lists chapters that may not be written yet, a table of contents can show "coming soon" for entries with no published file — the unfinished outline becomes a feature, not a gap. That's build-in-public for free, straight out of the data model.
The draft guard (don't leak unfinished work)
published: false has to mean invisible in production, reliably. On a prerendered site the guard is clean and absolute: only published files are handed to the static generator, and unknown paths return 404 instead of rendering on demand.
// the content route, prerendered
export const dynamicParams = false; // unknown/draft slugs → 404
export const dynamic = "force-static"; // build-time only
export function generateStaticParams() {
return getPublishedChapters().map(/* … */); // drafts never enter the list
}
A draft is then literally not a page — there's no URL to leak, nothing rendered, nothing to accidentally index. (This same force-static also sidesteps a Workers-runtime wall, for a different reason — see the first chapter.)
The tradeoff: publish = rebuild
The honest cost of git-as-CMS: publishing requires a build + deploy. There's no "click publish and it's instant." Flip published: true, commit, the build prerenders the new page, deploy ships it.
In practice this doesn't hurt, for two reasons. First, it was already true — a code-repo site rebuilds on every change anyway; content is just another change. Second, builds are fast and deploys are pushes, so "publish" is a commit and a one-line deploy. What you lose in instant-publish you more than recover in never running a CMS. For a weekly cadence, it's a non-issue.
One source, many outputs
The deeper reason this architecture is worth it: when your content is structured plain text, it's a source you can transform, not a final format trapped in a database. The same chapter becomes a web page, a newsletter issue, a social thread, a translated post, a slide — by transformation, not by re-authoring.
That's the real payoff of refusing the CMS. The content isn't locked in a rendering engine; it's portable text that fans out to every channel. Write once, publish everywhere — and the "everywhere" is just more transforms over the same files.
The scoreboard
| The CMS | git — content is markdown, publishing is a commit |
| Structure | a typed registry in code; prose in markdown frontmatter |
| Draft guard | published: false + force-static → drafts aren't pages, can't leak |
| The tradeoff | publish = rebuild + deploy (already true for a repo site; fast) |
| The payoff | one plain-text source → web, newsletter, social, translations, ebook |
That closes the build of this site: running on the edge, on its own domain, publishing from git. The site now does the thing it was built to do — turn what I learn into something published — and this series is the first proof of it. The loop continues as the building does.