The documentation site of the temples packages — built with temples itself.
content/*.md ──Bun.markdown──▶ HTML fragments
│
layout.html ──@temples/ssr prepare()─▶ www/<slug>.html + www/assets/style.css
content/*.md ──raw copy─────────────▶ www/<slug>.md (plain-text counterpart)
│
└──▶ www/llms.txt (agent index, links the .md files)
content/*.md— one file per page. The front-matter block carriestitle,description, andorder(nav ordering). A page withhidden: trueis built but stays out of the navigation andllms.txt.content/404.md— the 404 error page, kept out of the navigation byhidden: true.layout.html— a temples template: the nav iteratessite.pages(data-iterate), the page body is injected withdata-bind="html=page.content". The head declares the markdown export of the page with<link rel="alternate" type="text/markdown">, kept only whiledata-render-if="page.markdownUrl"is truthy — hidden pages carry an emptymarkdownUrl, so they emit no link. It also declares<link rel="describedby" href="llms.txt">, the agent index covering the site, as recommended by llmstxt.org.src/markdown.ts— the only module that touchesBun.markdown(an unstable Bun API), so a parser swap stays a one-file change.src/build.ts— the pipeline.buildSite()is exported for tests; the script runs it when executed directly. It copies every visible page as raw markdown next to its HTML file.src/serve.ts— serveswww/with a Bun file route for the root, and afetchhandler for every other path. When the path does not name a file inwww/, the handler serves404.htmlwith status 404.
Run these commands from inside packages/docs/. The build regenerates www/ completely,
so never edit its files by hand.
bun run build # build the site into www/
bun run serve # serve www/ at http://localhost:4173
bun test # the build has a smoke test (build.test.ts)The site is a plain static output: any static host works, with www/ as the publish directory
and bun install && bun run build:docs as the build command.
- GitHub Pages —
.github/workflows/deploy-docs.ymldeploys on every push tomaster. Pages serves the site under a subpath (/temples/), which the build supports because all asset and page links are relative. Pages also useswww/404.htmlas its error page. - Vercel / Netlify / Cloudflare Pages — create a project pointed at this repository with:
- build command:
bun install && bun run build:docs - output directory:
packages/docs/www
- build command:
- LLM agents — the build emits
www/llms.txt, an index of every page with absolute links to its raw markdown (<slug>.md), so agents fetch plain text instead of HTML.