Right, so you’ve got your terms set up and your content tagged. Now comes the fun part: actually showing off that curated list of content on the taxonomy term page. This is Hugo’s way of saying, “Hey, you asked for all the pages tagged ‘banana-bread’, here they are.” It’s a powerful concept, but the default template can feel a little… sparse. Let’s fix that.
The magic happens in a template file at /layouts/_default/taxonomy.html. If that doesn’t exist, Hugo falls back to its internal default, which is about as exciting as plain toast. We’re going to make banana bread toast.
The Core Loop: .Pages Inside your taxonomy.html, the most important variable is .Pages. This is a collection of all the pages that have this specific term. Your job is to range over them and display what you need.
<!-- layouts/_default/taxonomy.html --> <main> <h1>Posts about {{ .Title }}</h1> <p>Here you'll find all {{ len .Pages }} of my brilliant thoughts on {{ .Title }}.</p> <ul> {{ range .Pages }} <li> <article> <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2> <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time> <p>{{ .Summary }}</p> </article> </li> {{ end }} </ul> </main> Why .Title and not something like .Data.Term? Because the .Title of the taxonomy page is the term, nicely capitalized. Hugo’s doing you a solid. The .Data family ({.Data.Term}, {.Data.Plural}}) is still there if you need it, but .Title is cleaner for this purpose.
Pagination: Because Your “Recipes” Tag Might Blow the Stack If you have a popular term with hundreds of pages, dumping them all into a single HTML page is a performance nightmare. We need pagination. This is where Hugo’s built-in paginator shines. We don’t use .Pages directly; we hand the collection off to the paginator.
<!-- layouts/_default/taxonomy.html --> {{ $paginator := .Paginate .Pages }} <main> <h1>Posts about {{ .Title }}</h1> {{ range $paginator.Pages }} <!-- Your article rendering code from above --> {{ end }} <!-- This next part is non-negotiable --> {{ template "_internal/pagination.html" . }} </main> The _internal/pagination.html template is Hugo’s gift to you—it generates sensible “Previous / Page 2 / Next” links. You can absolutely create a custom pagination.html template if you want it to match your site’s style, but for getting started, the internal one is a lifesaver.
The Summary Gotcha Notice I used .Summary in the first example. It’s convenient, but it’s also a trap. Hugo generates the summary by either taking the first 70 words of your content or everything before a manually inserted `