Tagged sections not appearing on taxonomy page

Hi there! I have a content hierarchy that looks like this:

Screenshot_238
Adding tags to files not named “_index.md” appear to work. For instance “untitled.md” has this front matter:

---
title: "Untitled"
date: 2019-12-02T19:51:57-06:00
gameDate: 3200-01-01
tags: "adventure"
---

But when I add tags to an “_index.md” file, the pages do not appear in the taxonomy list. For example the “_index.md” under the folder “heydon” has this in its front matter:

---
title: "Heydon"
date: 2019-12-02T19:51:57-06:00
tags: "planet"
---

Are these pages not supported? Or is there a setting I need to adjust? Or maybe my hierarchy is wrong?

Off the top of my head I’m not sure it is supported. Assuming it is, the place I’d check is my taxonomy template, where I’m calling content. It is a common default for themes to limit their various list templates to regular content pages.

Why wouldn’t this be allowed?

Also I double checked my taxonomy list template and it doesn’t appear to be the issue, but here it is just in case I’ve missed something:

<!DOCTYPE html>
<html>
{{ partial "header.html" . }}

<body>
	<div class="container wrapper tags">
		{{ partial "head.html" . }}

		<h1 class="page-title">All tags</h1>

		{{ $biggest := 1 }}
		{{ $smallest := 1 }}
		{{ $max := 3 }}
		{{ $min := 1 }}
		{{ $size := $min }}

		{{ $data := .Data }}
		<div class="tag-cloud">
		{{ range $key, $value := .Data.Terms.ByCount }}
			{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
			{{ $size := (cond (eq $biggest $smallest) $min $size) }}
			<a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a>
		{{ end }}
		</div>
	</div>

	{{ partial "footer.html" . }}
</body>

</html>

EDIT: I found this page which says:

Once a taxonomy is defined at the site level, any piece of content can be assigned to it, regardless of content type or content section.

This makes it seem like it should work. :thinking:

Hey SHiLLySiT, just wanted to say I’m having the same issue as posted here: Rendering section pages in taxonomies

1 Like

Based on your thread, it sounds like we’re having the exact same problem. Glad its not just me!

1 Like

I think I’ve just run into the same issue. A site that built successfully in earlier versions of Hugo (some time before 0.57, I think) has just stopped working. The site contains ‘_index.md’ files with taxonomy declarations in the front-matter; those taxonomies don’t appear in the taxonomy list for the site. However, if I change the filename to ‘index.md’, they do (but then other stuff gets messed up).

As @vdadfar observes, other people have run into this same issue as well. However, I haven’t seen any word from the Hugo gods (Hugods?) on how we’re supposed to handle this. It seems that Branch Bundle pages (indexes) could once have taxonomies and now they can’t. I don’t know if this is a regression, or policy.

Because this has now been report by three people (myself, @angusm, and @vdadfar) I opened an issue on Github that has a barebones project that replicates the issue.

2 Likes

Thanks, I was caught by this also and I thought I was going mad! The workaround of renaming from _index.html to index.html works in my case but it would be great to see this fixed.

Unfortunately that solution doesn’t work in all scenarios as renaming to index.html loses the section status and thus you can’t (as easily) comb through all pages in a given “section”

I’m definitely hoping for a solution to this. I’m creating an ‘about’ page in each section (with a blank _index.md page). It’s more complicated and makes linking more difficult.