Loop Through Taxonomy

Trying to generate a list of content. Is there a way to do something like this?

{{ range where .Site.Pages "Section" "products" ( For Each Product Taxonomy ) }}

  <h1><a href="/{ .taxonomy }/">{{ .taxonomy }}</a></h1>
  <ul><a href="/{{ .taxonomy }}/{{ .term }}">{{ .term }}</a></ul>

{{ .Render "li"}} {{ end }}

output

Blue
- Product 1
- Product 2
- Product 4

Red
- Product 3
- Product 5

Green
- Product 2
- Product 5

In this case one product can have multiple colors.

hmmm… now that I’ve typed this up… looks like a use case for grouping?

I think you loop could be simplified as follows:

{{ range $name, $taxonomy := .Site.Taxonomies.products }}
{{ end }}

But your example doesn’t show how you do assign a color to the products.