From 3b1ef34bce6a9ed689aefce65ad01e66b6fce56f Mon Sep 17 00:00:00 2001 From: Klagarge Date: Sun, 11 Oct 2026 00:36:14 +0200 Subject: [PATCH] feat: enable PDF output for pages Assisted-by: Delta:zai-glm-5.3 --- README.md | 9 +++++++-- site/404.typ | 1 + site/calepin.toml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 259a09b..afe9668 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ target = "/.typ" Sidebar labels come from the page's `#metadata(...)` line, not from the config. +Every page also renders a printable PDF twin (`pdf = true` in +`calepin.toml`, selectable in the page's view picker). Add `pdf: false` to a +page's `#metadata(...)` to skip its PDF, as `404.typ` does. + ## Adding a category 1. Create `site//` with an `index.typ`, using @@ -69,8 +73,9 @@ sidebar. ## Deployment -`just build` produces a fully static site in `public/`: HTML pages plus -`sitemap.xml`, `robots.txt`, and `llms.txt`. The Gitea Actions workflow in +`just build` produces a fully static site in `public/`: HTML pages with +printable PDF twins, plus `sitemap.xml`, `robots.txt`, and `llms.txt`. The +Gitea Actions workflow in `.gitea/workflows/build.yml` builds the site on every push with the same pinned toolchain and uploads `public/` as an artifact for deployment to any static host. diff --git a/site/404.typ b/site/404.typ index 1f94c8c..7c9fae2 100644 --- a/site/404.typ +++ b/site/404.typ @@ -1,4 +1,5 @@ #set document(title: [Not found]) +#metadata((pdf: false)) #title() diff --git a/site/calepin.toml b/site/calepin.toml index fade09e..3d3e9fd 100644 --- a/site/calepin.toml +++ b/site/calepin.toml @@ -2,7 +2,7 @@ title = "Yggdrasil" description = "Personal knowledge base." base-url = "https://yggdrasil.kb28.ch" theme = "themes/yggdrasil" -pdf = false +pdf = true minify = true search = "pagefind" logo = "assets/yggdrasil.svg"