{{ $pages:= slice}}
{{ range . }}
    {{ if .HasChildren }}
        {{ $nestedPages:=partial "helpers/get-pages.html" .Children }}
        {{ $pages = $pages | append $nestedPages }}
    {{ else }}
        {{ $pages = $pages | append .Page }}
    {{ end }}
{{ end }}
{{ return $pages}}
