Flatpack: A Minimal Flat-File CMS for Cloudflare

Most content management systems solve problems you do not have. Databases, admin panels, user authentication, plugin ecosystems — infrastructure that exists to support infrastructure. Flatpack takes the opposite position: a publishing system reducible to a folder of Markdown files, a build script, and a deployment target.

What it is

Flatpack is a static site generator built on a single architectural premise — that a publishing operation does not require a database, a server, or a framework. Content lives in Markdown files. A Node.js build script reads those files, renders them to HTML, and outputs a complete site: posts, pages, a paginated index, an archive, RSS, sitemap, and a 404 page. The output deploys to Cloudflare Pages or any static host.

The entire toolchain is readable in an afternoon. There are no abstractions you cannot trace to their source.

How it works

Posts go in a content/ directory. Pages go in pages/. Both use standard frontmatter:

---
title: "Post Title"
date: 2026-04-24
draft: false
---

Running npm run build compiles everything to a dist/ folder. Pushing to GitHub triggers an automatic rebuild on Cloudflare's build servers. The deployed site is pure HTML — no JavaScript, no external requests, no runtime dependencies.

The design constraints

Flatpack enforces a small set of deliberate constraints. No tags. No featured images. No description fields. No admin interface. No search. No comments. These are not missing features — they are decisions about what a publishing system actually requires at its foundation.

The CSS is a single file. The templates are JavaScript template literals. The build script is under 200 lines. Configuration is a single JSON file.

Where it fits

Flatpack is not a Hugo replacement. Hugo builds thousands of pages per second from a self-contained binary with no runtime dependency. Flatpack requires Node and ages with its dependencies. For production publishing at scale, Hugo wins on every practical measure.

Flatpack is useful when you want to understand exactly what a static site generator does, when a site is too simple to justify Hugo's configuration surface, or when you want a system with no moving parts you did not put there yourself. It is a reference implementation — deliberately minimal, fully owned, with a defined ceiling.

The output is identical to Hugo's: plain HTML files that deploy anywhere static files are served.