So I want to make sitemap showing content from folders within content folder. But when I list them it’s showing a list of all pages on website including tags. My question is, how can I change this code to list only content from specific folder e.g.: content/adventure/
You can use range together with the where function to filter .Site.RegularPages, which returns a collection of all your regular content pages + custom outputs.
For example:
{{ range where .Site.RegularPages "Section" "adventure" }}
<!-- Do something with all posts from /content/adventure/ -->
{{ end }}
…or…
{{ range .Site.RegularPages }}
<!-- Do something with all posts from /content/,
excluding tag and category pages -->
{{ end }}
You can find more about range, .Site.RegularPages, and where in the documentation.