How this wiki is built
cataract.wiki is a Cataract application; here is every moving part.
This site is not generated by a static site generator and then served by something else. It is a Cataract application: one binary that reads a directory of Markdown at start-up, renders it to sanitised HTML once, and serves every page from memory.
content/
docs/ the documentation tree; folders become URL segments
app/
lib/ the content pipeline and the site chrome
routes/ four routes, three of them pages
islands/ one island: search
layouts/default.chpl one layout for the whole siteIn this section
- The content pipeline — from a file on disk to a record in memory
- Markdown and frontmatter — what the parser supports
- Sanitisation — the allow-list, and why generated HTML is still filtered
- Search and islands — the JSON API and the two client components
The whole route table
api /api/search GET app/routes/api/search.chpl
page /docs/[...path] GET app/routes/docs/[...path].chpl
api /docs GET app/routes/docs/index.chpl
page /[...path] GET app/routes/[...path].chpl
page / GET app/routes/index.chpl/docs is an API route rather than a page because it does one thing: redirect to the introduction. A catch-all does not match its own parent path, so without that file /docs would be a 404.