Not sure how to post Tips or Hints for others, but we were using the Zola functions for taxonomy and because we don’t know rust that well or the tera template language that well.
If you want to build a dynamic menu of your taxonomies then this code might help you.
We ended up learning how to parse the config taxonomy data, to run through all the taxonomy ‘kinds’ and then we found you have to skip the first item as its not an irritable collection, which made things hard for our non coder template writer. anyways code says it best:
{# Keep as an example of how to drill down through taxonomy levels
{% for tax in config.taxonomies %}
Taxonomy Name: {{tax.name}} <br>
{% set categories = get_taxonomy(kind=tax.name) %}
{% for name, items in categories %}
{% set length = items | length %}
{% if length > 0 %}
Total items: {{length}}
<br>
{% for item in items %}
{{item.name}},
{% set url = get_taxonomy_url(kind=tax.name, name=item.name) %}
{{url}} <br>
{% endfor %}
{% else %}
First Item: {{items.name}}
{% endif %}
{% endfor %}
{% endfor %}
#}
Our config.toml file looks like this:
taxonomies = [
{name = "tags", rss = false, paginate_by = 5},
{name = "english", rss = false, paginate_by = 5},
{name = "authors", rss = false, paginate_by = 5},
{name = "downloads", rss = true, paginate_by = 8},
{name = "podcast", rss = true, paginate_by = 75},
]
Note: If you have a lot of tags (we have 100+) and do this processing for every page (like in a site menu) then the build process will slow down dramatically.
If you know a better way or cleaner way please share