Hello, I have an older site on Hugo that hasn’t been fully updated yet. I’ve noticed that layouts/_default/tag.terms.html
is no longer used in the recent versions of Hugo. I might be wrong, but from what I’ve noticed, there are now two files instead: layouts/_default/taxonomy.html
and layouts/_default/terms.html
. Is that correct?
In the Hugo documentation, the original layouts/_default/taxonomy.html
template uses an H2
headline for each tag when listed, which seems a bit strange to me since it looks more like a list. I was wondering if there’s anything wrong with tweaking this template to use an unordered list when accessing https://mywebsite.com/tags/
?
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ range .Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}
{{ end }}
modify to this, with the addition of “count” :
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<ul class="tags">
{{ range .Pages }}
<li><a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a> ({{ .Count }})</li>
{{ end }}
</ul>
{{ end }}
Or even better, I would like something similar to the Hugo tags page found here, with the tags displayed in two or three responsive columns: HUGO
Being able to change the sort by name and count on the website is probably a feature implemented with JavaScript, right? I don’t think I’ll have more than 100 tags, so pagination isn’t really worth it for that. However, pagination might be important once I click on a tag and all the articles under that tag appear. What do you think?
I would be grateful for any suggestions you can offer. Thank you.