A static site generator in 200 lines
I have used the big static site generators. They are good tools, but for a site with a dozen pages the build step felt heavier than the writing. So I replaced the toolchain with a single script under two hundred lines, using only the standard library.
The architecture is boring on purpose. Every note is a text file with three lines of front matter: title, date, slug. Every page is an HTML template with placeholders. The build script reads one into the other and writes plain files to an output directory. A content dictionary in memory, a loop, done.
The only non-obvious part is incremental builds. The script keeps a small JSON cache mapping each source file to its size and mtime; anything unchanged skips regeneration. A full rebuild of the site takes under fifty milliseconds anyway, but it keeps the habit of running the build after every save.
RSS turned out to be forty lines: sort the notes by date, escape the XML entities, print. The escaping is the whole difficulty; everything else is string formatting.
The output is plain files. Any web server can serve them, and moving to a different one is a copy command. That portability is the real feature — the site exists independently of whatever tool produced it.
Not a recommendation for everyone: if you need taxonomies, drafts and image pipelines, use the established tools. But if your site is small and your patience for toolchains is smaller, two hundred lines go a long way.