HUGO

Is it possible to create taxonomy list pages only for a subset of taxonomy term?

I have a taxonomy with many values and I would like to create taxonomy list page for only a few of them (e.g. only create taxonomy list page when there is more than 1 post associated with the taxonomy term). Is there a way to achieve this in hugo?

It’s a bit of work. You can add an content/taxonomyname/taxonomyterm/_index.md for every taxonomy you DON’T want to show up and use _build frontmatter to disable generation.

Another method would be a post-production script that deletes all pages that you don’t want to keep.

2 Likes

Hi @davidsneighbour Great to know it is possible, thank you!

We had a similar request last year. The client said they did not want to generate a term page if the term was applied to only one content page.

Upon further questioning, we determined that the client didn’t care about generating the term page. What they really wanted was to hide the term on taxonomy and content pages if the term was applied to only one content page.

Those are two very different problems, and the second one was easy to solve.

2 Likes