Martin Ludwig
← All posts

Static blogging with Astro and Keystatic

This blog is built from markdown files with Astro. There is no database and no runtime rendering — every page you see is a static HTML file generated at build time. Keystatic adds a small admin UI on top that edits those same files.

Why static

Static pages are the right default for a personal blog:

  • Fast. nginx serves a file. Nothing to compute per request.
  • SEO-friendly. The full article HTML is in the initial response, so crawlers and social scrapers see real content — not an empty <div>.
  • Cheap and durable. No server process to crash, no DB to back up.

How a post becomes a page

  1. Write (or edit in Keystatic) a markdown file with some frontmatter.
  2. astro build reads the content collection and renders each post.
  3. The result is written to dist/blog/<slug>/index.html with SEO meta, RSS and a sitemap alongside it.
import { getCollection } from "astro:content";
const posts = await getCollection("posts");

GFM works out of the box

FeatureSupported
Tablesyes
Task listsyes
Strikethroughyes
  • [x] Render markdown
  • [x] Generate RSS + sitemap
  • [ ] Write more posts

The public site ships zero client-side JavaScript. Keystatic's React UI only loads in the editor, never on a published page.

That's the entire idea.