.LinkTItle not showing up for Tags where I created _index.md in posts/tags/mymissingtag

I am using the exact code from https://gohugo.io/templates/taxonomy-templates/#example-list-tags-in-a-single-page-template and it works fine for all tags except when I create a _index.md file to give the tag some context.

If I delete the file and folder in posts/tags/mymissingtag/_index.md it shows back up on my single and list pages. I am not changing any code only the existence of that file determines if “.LinkTitle” shows up.

The actual link .Permalink is there but with no “LinkTitle”

{{ range (.GetTerms "tags") }}
    <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>

{{ end }}


what am I missing? I searched around but didn’t find anything similar

While in the shower … I figured that maybe the .LinkTitle would be coming from the front matter in the _index.md file which I didn’t have.

I just tested and that was the issue.

So if you read this later and have the same problem be sure to add title in your _index.md file and you will be good to go.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.