Skip to content
FLAVIO COPES
flaviocopes.com
2026

Hugo iterate pages of section

~~~

I had the need to iterate over the pages of a specific section in Hugo, which means markdown files put inside a folder under content, like content/mysection.

Here’s the code to do that:

{{ range (where .Site.Pages "Section" "mysection") }}
  {{ range .Pages }}
    {{ .RelPermalink }} - {{ .Title }}
  {{ end }}
{{ end }}
~~~

Related posts about hugo: