# Hugo iterate pages of section

> Learn how to iterate over the pages of a specific section in Hugo using range and a where filter on .Site.Pages to loop the markdown files in that folder.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2022-07-09 | Topics: [Hugo](https://flaviocopes.com/tags/hugo/) | Canonical: https://flaviocopes.com/hugo-iterate-pages-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:

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