It would be nice if Hugo recognized taxonomy terms as maps, in addition to strings, in pages’ frontmatter. For example, taking a taxonomy named
contributors, I could then use a frontmatter like:
# how it could be contributors: - name: Mary # term string role: author - name: John # term string role: editor - Paul # term string, as today, to not break existing sites
Facing a taxonomy like that, Hugo could read only
contributors.name (or another key, like
term) to store the page terms. That way, one could specify not only the page terms, but the relation of page to each term. One could then use those “relation” values (like
role) in templates, allowing a richer data model.
I think today this is not possible (please correct me if I’m wrong) without doubling those values:
# how it's today # actual terms contributors: - Mary # term string - John # term string - Paul # term string # relation to terms contributorRoles: - name: Mary role: author - name: John role: editor - name: Paul
Is it possible or even feasible?