I’m trying to exclude the taxonomies tags and categories from the sitemap.xml, but trying to exclude simply tags doesn’t work when using if eq .Data.Singular .Kind "tags".
How can I exclude one taxonomy? Or multiple taxonomies?
This is the simplified loop from layouts/_default/sitemap.html
{{ range .Data.Pages }}
{{ if eq .Data.Singular .Kind “tags” }}
{{ else }}
// function that generates xml
{{ end }}
{{ end }}
And: how could I exclude multiple taxonomies, but include one?
Thanks, good points. I found {{ if not (or (hasPrefix .RelPermalink "/tags") (hasPrefix .RelPermalink "/categories")) }} and was using that, but your methods are cleaner and don’t rely on reading the permalink, and/or can be set in config.toml.