Hi, I’ve just stared using Zola and I’m working on my own templates. My objective is to display the first term from both taxonomies in the template ‘recept.html’ preferable with a link. So when people click on the link they get all a list of all recipes with the same term.
I have added two taxonomies to zola.toml (main section):
taxonomies = [
{ name = "recept-moeilijkheidsgraad", feed = true},
{ name = "recept-tijdsduur", feed = true},
]
In my template ‘recept.html I have the following:
<li>Moeilijkheidsgraad: {{ page.taxonomies.recept-moeilijkheidsgraad[0] }} </li>
<li>Tijdsduur: {{ page.taxonomies.recept-tijdsduur[0] }} </li>
And in my content (a-recipe.md) I have:
recept-moeilijkheidsgraad = [ "makkelijk" ]
recept-tijdsduur = [ "10min" ]
At this moment I get the following error:
ERROR Failed to build the site
ERROR Failed to render page ‘/home/bjorn/Documents/Doeidag/website/content/recepten/Recept-een-oude-laptop-voorzien-van-Linux-Mint.md’
ERROR Reason: Failed to render ‘recept.html’
ERROR Reason: Variable page.taxonomies.recept not found in context while rendering ‘recept.html’
I wonder if I can use hyphens in the taxonomy name? Can I use [0] to select the first term only? Is this a proper way to do this?
Sorry I’m a complete newbie with Zola, Tera and Rust so please excuse my ignorance.