How this wiki is built

cataract.wiki is a Cataract application; here is every moving part.

Updated 1 min read

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 site

In this section

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.