Surely it is a lazy question and you shall answer “try and see”.
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ $taxonomyObject := .Site.Taxonomies.tags }}
{{ range $taxonomyObject.Alphabetical }}
<p>
<a class="btn btn-outline-dark font-125" href="{{ .Page.RelPermalink }}">
<span class="badge badge-dark">({{ .Count }})</span> {{ .Page.LinkTitle }}
</a>
</p>
{{ end }}
{{ end }}
This code produce a localhost:1313/tags/ where each tag is linked to its ‘tag-name’ page on which there is an alphabetical ordered list of tags.
As I follow this tutorial Make a Hugo Blog From Scratch it is not really what we want, actually the result above in the tags page.
But If I change {{ $taxonomyObject := .Site.Taxonomies.tags }} by {{ $taxonomyObject := .Data.Term.Alphabetical }} an error occurs
ERROR error building site: render: [en v1.0.0 guest] failed to render pages: render of "/tags/life" failed: "/home/pierre/public/hugo-blog/layouts/term.html:11:18": execute of template failed: template: term.html:11:18: executing "main" at <.Data.Term.Alphabetical>: can't evaluate field Alphabetical in type interface {}
Is it because my template is term.html and not taxonomy.html ?