Most personal blogs are either a static site generator or a full CMS. onhlt is neither: it is one Rust binary that serves server-rendered pages, syncs Markdown from Git and keeps a snapshot of my GitHub activity. This post explains why.
What a blog actually needs#
A blog is a reading product. The first byte must contain the whole article, the page must work without JavaScript, and nothing slow should sit between a reader and the text.
That rules out a few things straight away:
- Client-side rendering. A WASM or SPA bundle adds work before the first paragraph is readable.
- Calling GitHub at request time. Rate limits and latency would leak into every page view.
- A database as the source of truth. Text belongs in Git, where it is versioned, reviewable and diffable.
The shape of the system#
The binary has three jobs, each a Tokio task:
- Serve HTTP with Axum. Pages are rendered by Askama templates that are compiled and type-checked with the rest of the code.
- Sync content. A signed GitHub webhook triggers a
git fetch, the Markdown is parsed, and the whole index is replaced in a single PostgreSQL transaction. - Refresh GitHub data every 30 minutes and store it, so pages only ever read a snapshot.
Why Axum, Askama and SQLx#
pub async
- Axum sits on Tower, so tracing, timeouts and compression are ordinary middleware.
- Askama catches a typo in a template at
cargo checktime, not in production. - SQLx keeps the SQL visible. Full-text search,
jsonband CTEs are first-class instead of fighting an ORM.