1 min read
pyssg.plugins.taxonomy
Taxonomy plugin: tags + categories, zero-config.
A taxonomy is a named classification dimension; tag and category are two
built-in instances of one mechanism, so adding another dimension is
configuration, not engine code. During evaluate_collections it reads the
relevant frontmatter keys from every document, builds each term's member list,
and materializes virtual pages: a term page per term (/tags/<term>/,
/categories/<a>/<b>/) and an index page per taxonomy (/tags/). Categories
are hierarchical: category: a/b makes the document a member of both a and
a/b.
Incremental: term pages are recomputed deterministically each finalize, so adding/removing a term adds/removes the right page (the engine's page-set diff cleans vanished outputs) and a term page re-emits only when its membership actually changes (render cache + emit cutoff).
class Taxonomy
One classification dimension.
tag() -> Taxonomy
category() -> Taxonomy
build_taxonomies(build: Build, taxonomies: list[Taxonomy]) -> None
class TaxonomyPlugin
Built-in taxonomies; defaults to tag + category.
TaxonomyPlugin.apply(self, builder: Builder) -> None
taxonomy(*taxonomies: Taxonomy) -> TaxonomyPlugin
Factory. No args -> tag + category zero-config.