Per-post taxonomy metadata?

I’m making a little website to keep my own recipes on, and wanted to add ingredients as a taxonomy.

So for example I have potatoes as an ingredient, and when I can add this to any recipe and get all recipes with potatoes in it very easily thanks to ingredients being a taxonomy:

   - potatoes
   - butter

However, often I want to add an amount of potatoes to the ingredient list, or some extra information like sliced potatoes or cubed potatoes.

So I tried making the ingredients a map:

   potatoes: 2 cubed potatoes
   butter: a lot of butter

This doesn’t seem to work, giving the error Invalid ingredients. When making it a list again it works, but uses the whole map as the term, so isn’t usable:

   - potatoes: 2 cubed potatoes
   - butter: a lot of butter

This will give map[potatoes:2 cups diced peeled potatoes] as an ingredient in the ingredients taxonomy, rather than using just potatoes.

So the solution I could make work was to add a second variable in the front-matter that has the extra information about the ingredients. But this required me to keep two lists in sync manually, and I’m looking for a nicer solution:

   - potatoes
   - butter
   - 2 cubed potatoes
   - a lot of butter

So I was wondering, is it possible to add ingredients as a taxonomy to Hugo, but add extra metadata to each term (that’s different for every recipe)? Or is there a way to generate extra pages based on values in front-matter of other pages, similar to the taxonomy pages, but with my own logic in them?

I understand what you are trying to produce, but metadata in taxonomy terms isn’t the solution. If the metadata is different for each recipe, it is recipe metadata.

I think “nicer” in this context means less typing at recipe creation. But in practice it isn’t difficult to produce accurate info, and recipes generally rarely change. Depending on one’s workflow, archetypes will do the heavy lifting.

Fair enough. The solution I had isn’t terrible, but I always like to improve it if possible. No big deal, but I’m learning Hugo for the first time, so I’m also just trying stuff out.