One Rust binary and Typst math
Unlisted not listed on the blog, in tags, or in the feed
Disclosure: this post was written by an AI — GLM 5.3 Flash, running as the orchestrator in opencode — about the rewrite of this very site. Yannick reviewed and edited it before publishing.
The short version of this site’s rewrite is in the previous post; this one is about the machinery.
One binary, no moving parts
The old site was Jekyll on GitHub Pages: Ruby toolchain, plugin quirks, and
nothing dynamic was ever going to happen. The new site is one Rust binary
(site) with three subcommands — serve, check and healthcheck — built on
axum, with Askama templates compiled into the executable. There is no database,
no build step at deploy time and no runtime rendering: at startup the binary
reads the Markdown and TOML files, renders every post and page once, and then
serves precomputed HTML strings. A request only fills in a template.
That startup rendering also acts as a build gate. site check renders
everything, including drafts, follows every internal link and exits non-zero on
any broken one — so a typo in a post can’t reach production. The Docker image is
distroless, runs as a non-root user, weighs 41.5 MB and refuses to finish
building if site check fails.
Typst math, inline and offline
The fun part is math and diagrams. Inline math like $e^(i pi) + 1 = 0$ becomes
, display
equations, CeTZ drawings, Lilaq plots and Fletcher diagrams are all written in
Typst inside the Markdown source. At startup, each snippet
is compiled and exported as a self-contained inline SVG with three properties
that make it feel native rather than bolted-on:
- Baseline alignment. The renderer walks the layout tree to find where the
first line’s baseline sits and emits
vertical-align: -<descent>em. Inline math like sits on your text’s baseline and scales with your font size, because sizes are set inem, not pixels. - Theme colors. Every black fill and stroke in the SVG becomes
currentColor, so math follows the light/dark mode like ordinary text, while real plot colors (a Lilaq blue line) survive untouched. - Nothing from third parties. The math on this page is fully self-contained: fonts are embedded in the binary, and the diagram packages (about 3 MB) are vendored into the repository, so rendering resolves everything from disk. Your browser never talks to a CDN or a web-font server — every request it makes goes to this site itself, search box included.
If a snippet has a syntax error, the post still renders: the broken block
becomes a visible error box, and site check fails with an exact file and line
number. Errors you can see beat errors you can’t.
WebAssembly, with the grain of the platform
The same code-block mechanism powers interactive demos: a ```wasm-demo ```
block becomes a placeholder figure, a small ES module lazy-loads the compiled
demo, and the demo (say, a canvas random walk) mounts itself with pointer events,
device-pixel-ratio-aware rendering and resize handling. Everything ships from the
same origin, under the site’s own CSP, with no third-party scripts. The hello
demo is about 74 KB including glue.
The stack, in short
axum for HTTP, Askama for templates, comrak for Markdown (tables, footnotes, alerts, math dollars), syntect for classed syntax highlighting with a light/dark theme pair, jiff for dates, and Typst for anything that wants to look typeset. Plain modern CSS with custom properties, mobile-first, two breakpoints, no frameworks. It is a boring stack on purpose — which is exactly what lets a $3.43 agent fleet build it in an afternoon without anyone having to be clever at 3 a.m.