+++ title = “Taxonomies” weight = 90 +++
Zola has built-in support for taxonomies.
A taxonomy has five variables:
name
: a required string that will be used in the URLs, usually the plural version (i.e., tags, categories, etc.)paginate_by
: if this is set to a number, each term page will be paginated by this much.paginate_path
: if set, this path will be used by the paginated page and the page number will be appended after it.
For example the default would be page/1.rss
: if set to true
, an RSS feed will be generated for each term.lang
: only set this if you are making a multilingual site and want to indicate which language this taxonomy is forExample 1: (one language)
taxonomies = [ name = "categories", rss = true ]
Example 2: (multilingual site)
taxonomies = [
{name = "tags", lang = "fr"},
{name = "tags", lang = "eo"},
{name = "tags", lang = "en"},
]
Once the configuration is done, you can then set taxonomies in your content and Zola will pick them up:
Example:
+++
title = "Writing a static-site generator in Rust"
date = 2019-08-15
[taxonomies]
tags = ["rust", "web"]
categories = ["programming"]
+++
In a similar manner to how section and pages calculate their output path:
slugify_paths
is enabled in the configurationThe taxonomy pages are then available at the following paths:
$BASE_URL/$NAME/ (taxonomy)
$BASE_URL/$NAME/$SLUG (taxonomy entry)