Home Documentation Templates Examples Showcase GitHub
Theme

Content · Classification

Taxonomies.

Nift keeps the familiar taxonomy model: declare a classification system once, reference it from schemas, and let terms emerge from typed content.

Declare taxonomies

@taxonomy(tag)
@taxonomy(section) {
    hierarchical: true
}

Taxonomy definitions live in .tax files configured explicitly:

"taxonomies": ["model/site.tax"]

Use them in schemas

@schema(article) {
    title: string
    tags: taxonomy(tag)[]
    section: taxonomy(section)?
}

Repeated terms resolve to one semantic term. Nift builds reverse indexes so each term exposes the content classified by it.

Query terms

$[tags := project.taxonomies.tag]
$[popular := tags.filter(t => t.content.size() >= 2)]

Term values expose name, a deterministic slug, and content. Hierarchical taxonomy terms written as paths also expose their parent path.

nift eval --json '(project.taxonomies.tag).map(t => t.name)'