Docs site¶
This site itself is declared in the flake. Content lives as Markdown under
docs/, is built with Zensical (the static site
generator by the Material for MkDocs team), and is served as static files by
Caddy on yggdrasil (public through Cloudflare Tunnel). Configuration uses
Zensical's native zensical.toml format.
English is the default language; a Korean translation is built as a separate
subsite under /ko/. The language selector in the header switches between
them.
Structure¶
docs/
├── package.nix # the derivation, wired via callPackage in flake.nix
├── shell.nix # dev shell for `zensical serve`, inherits package deps
├── Makefile # build (`make`) and install (`make install`) targets
├── zensical.toml # English (default) site config
├── zensical.ko.toml # Korean site config (full copy, TOML has no inheritance)
├── en/ # English content (source of truth)
└── ko/ # Korean translation, mirrors en/
- flake output
packages.<system>.docs: both languages built withzensical build --strict, Korean into theko/subdirectory - serving module
services/docs-site.nix: Caddyfile_server, public through Cloudflare Tunnel
Editing workflow¶
-
Edit the English page under
docs/en/first, then mirror the change indocs/ko/. A new page needs two extra touches, in both languages:- add it to the
navofzensical.tomlandzensical.ko.toml - give it a navigation icon via front matter at the top of the file:
--- icon: fontawesome/solid/<name> ---Icon names: zensical/ui icon sets. 2. Validate the build locally.
nix build .#docs--strictmode turns broken internal links into build failures. - add it to the
-
For a live preview, use the devShell.
nix develop .#docs cd docs && zensical serve # English cd docs && zensical serve -f zensical.ko.toml # Korean # open http://127.0.0.1:8000 -
Commit, then deploy. The docs are part of the system closure and update together.
just switch yggdrasil
flakes and git
Flake builds only see files tracked by git. New files must be
git added before nix build .#docs picks them up.