Is it possible to create categories for tags in taxonomies?

Maybe a bit of grouping could work like you want it to? Say,
/config.yaml :

taxonomies:
    tag: "tags" # This is the default anyway

/content/posts/mypost.md (and similar) :

---
tags: ["Rock"]
subtags: ["Metal"] # Not a taxonomy, just a param
---

/layouts/tags/list.html :

<ol>
    {{ range .Pages }}
    <li> {{ .Title }}
        <ol> 
            {{ range .Pages.GroupByParam "subtag" }}
                <li>{{.Key}}
                    <ol>
                        {{ range .Pages }}
                        <li><a href="{{.Permalink}}">😎{{.Title}}</a></li>
                        {{ end }}
                    </ol>
                    </li>
            {{ end }}
        </ol>
    </li>
    {{ end }}
</ol>

Which results in this (public/tags/index.html):

Screenshot from 2020-12-21 16-56-36

Check the full example if you want.

You’ll probably want to take a look at https://gohugo.io/templates/lists/ to see the different methodss available for these kinds of tasks.

1 Like