Skip to main content

why_artifacts

Function why_artifacts 

Source
pub fn why_artifacts(ctx: &Context) -> Result<Vec<Artifact>, Error>
Expand description

The Why catalogue and its graph, as the site’s templates read them: site/data/registry/why.json and site/data/registry/why-graph.json.

Both are projections of crate::why::Catalogue, which the context already built. Nothing here re-reads a file, and nothing here is a second opinion about what a moment says: the site generator writes one page per entry from this document, and the templates read it for every listing, filter, count, backlink and questionnaire.

The bodies are not in it: a page’s prose is read from the file the record names in source, so the dataset stays the metadata every listing, filter, count and backlink needs and never becomes a second copy of the writing.

Deterministic and index-independent: the payload depends on the catalogue’s own sources and on nothing else, so scripts/derive — which runs generate, then the site generator, then generate again over the tree that left — produces the same bytes in both passes.