Built with Zine. All commands assume the Nix dev shell:
nix develop # enter shell (provides zig, zine, librsvg)... or prefix each command with nix develop --command.
| Command | What it does | When to run |
|---|---|---|
zig build |
Build the site into zig-out/ |
Every change |
zig build serve |
Start the Zine dev server with hot reload | Local development |
zig build og |
Render assets/og.png from assets/og.svg |
When the site OG card changes |
zig build favicon |
Render assets/apple-touch-icon.png from the SVG |
When the favicon changes |
zig build og-posts |
Render content/blog/<slug>/og.png for each post title |
Standalone re-render; otherwise automatic |
zig buildwipeszig-out/before invoking Zine (Zine refuses to write to a non-empty output dir). No manual cleanup needed.
zig buildandzig build servedepend onog-posts, so each post'sog.pngis rendered before Zine runs. Adding a post no longer needs a separateog-postsinvocation.
Posts can pull line-ranged snippets from external repositories without copying
the code into the post. Each content/blog/<slug>/code-deps.json declares the
upstream commit and the files the post references:
{
"source": "github:q-uint/zine@eac08713d063586c161fca211533fea77c074b22",
"files": ["src/root.zig", "src/context/utils.zig"]
}Supported forges: github, codeberg, gitlab. The build fetches each file
once via curl and caches it under .snippet-cache/<commit>/<path>.
In the post's .smd, reference a snippet by basename and line range:
[]($code.buildAsset('<slug>/utils.zig').language('zig').lines(38,68))
build.zig's rewriteSmd rewrites that directive into a hyperlink pointing at
the pinned source range on the forge (e.g.
https://github.com/q-uint/zine/blob/<commit>/src/context/utils.zig#L38-L68).
Zine still resolves the underlying $code.buildAsset call against the cached
file to embed the snippet itself.
assets/og.svg→assets/og.png— the site-wide social cardassets/favicon.svg→assets/apple-touch-icon.png— favicon raster fallbackassets/og/post-template.svg+ each post's.title→content/blog/<slug>/og.png
The OG card and per-post cards use Space Grotesk Bold. librsvg's renderer goes
through Pango, so the build steps set PANGOCAIRO_BACKEND=fc and
FONTCONFIG_FILE=assets/og/fonts.conf to point at the local TTFs in
assets/og/. The web pages themselves use self-hosted WOFF2 in assets/fonts/
referenced from assets/style.css.
assets/ # site-wide assets (CSS, fonts, OG/favicon sources)
content/ # markdown posts and section indexes
blog/<slug>/
index.smd # post frontmatter + body
code-deps.json # external code references for this post
og.png # generated by `zig build og-posts`
layouts/ # Zine SHTML templates
build.zig # content cache + asset render steps
zine.ziggy # Zine site config
Generated PNGs (site OG, favicon raster, per-post OG) are committed so a normal
zig build works without librsvg. Re-run the relevant step after editing the
SVG sources or post titles.