More flexible taxonomies

It’s quite restrictive that taxonomies live at [taxonomy]/single.html and [taxonomy]/list.html. Would it be possible to allow customisation of these paths?

In addition, could taxonomies have associated meta data, specifically a place to store a description of the taxonomy and a description of each term within it?

What’s the use-case there?

I would just chuck that in the [extra] section of the config or in the templates directly.

Tags for sections. For example, if I have a section /games/ I can’t also have a taxonomy [games] because it’ll live at the same location as the section which Zola doesn’t allow. I can’t see a way around this with the current implementation, unless I’m missing something?

I did try that in the config, but it starts to get very unwieldy for many taxonomies and terms. Adding them directly to templates is unworkable as I keep content and structure separated.

I think I could make a workaround using external text file descriptions and use load-data. I’ll investigate that.

I see. You were talking about the template path but you actually want to change the output path, that makes more sense

1 Like

Ah yes, that’s exactly it, sorry for any confusion. Perhaps then an output path could also be allowed as part of the taxonomy definition? For example:

taxonomies = [
    { name = "games", path = "games/tags", feed = true}
]

Any chance that custom output paths for taxonomies will become a feature? I frequently need to do section based tags and have had to create messy post-build scripts to sort it all out. Would be awesome if Zola could support it out of the box.

I was fiddling around with Zola recently trying to make the same thing work, and it turns out if you set slugify to false on taxonomies, it’ll interpret the slashes as a path? So creating a taxonomy like “resources/layouts/tags” actually puts the taxonomy stuff in the resources/layouts/tags folder.

You’d think it wouldn’t work, but it does, apparently.

Huh! I tried it and it works. Sorta. The files are generated at the path as you discovered, but because taxonomies are no longer slugified, the URLs are ugly and need more thought when linking in content. I’m not sure that change is worth the bother, but it’s an interesting technique nevertheless. Likely a bug really, but clever to exploit it this way.

I’m almost considering learning Rust just so I can raise a PR for this feature. Because I don’t really understand why it’s not made it into any new releases: it would be incredibly useful and really improve Zola’s ability to provide more flexibility for self contained sections with their own taxonomies. One can live in hope I guess…