I would like to extract the Top Tag or Top Category in my content, namely the tag or category which has the highest number of pages. I need to do this in a generic page, so I can only rely on the .Site.Taxonomies
variable.
The problem is that, when I query .Site.Taxonomies.tags
or .Site.Taxonomies.categories
I get a list of maps that does not include the term name!!!
{{ $terms := .Site.Taxonomies.tags }}
{{ range $terms }}
<span>{{ .Name }}</span><br/>
{{ end }}
This code throws an error as .Name
is not defined. How can I achieve this?