Create anti-taxonomy? all pages without tag?

Hi there, I wonder if it is possible to create a custom taxonomy of pages that do not contain a tag.
So here is my usecase: I have a recipe website with a custom taxonomy of ingredients, which is great, you can look up all recipes with apples! But I’d like to make pages with the reverse, all recipes without ‘tomato’ for instance.

How would I go about this?

I noticed someone did use some tag exclusion on a page in this post https://discourse.gohugo.io/t/exclude-posts-from-a-list-containing-a-specific-tag/17174 but I’m not sure if this solves my issue. Any pointers?

Could you give more details about it? Would those be defined somewhere (ie.: front matter) or generated automatically based on the taxonomies being used by a page?

Oh sorry, yes of coursr!
So in my example I have an extra taxonomy ‘ingredients’ that is added to every frontmatter of every recipe.
What I would like is an extra page with a list of all the ingredients amd clicking on an ingredient brings you to a page of recipes ( pages) without those ingredients. So all ingredients listed on a page, and clicking on ‘tomato’ brings you the pages without tomato as ingredient.

Try this:

git clone --single-branch -b hugo-forum-topic-27887 https://github.com/jmooring/hugo-testing hugo-forum-topic-27887
cd hugo-forum-topic-27887
hugo server
1 Like

This is amazing! I think it works!

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