What I found confusing is that to get the pages from a section I run the following code.
{{ $articles := where .Site.RegularPages.ByPublishDate.Reverse "Section" "interview" }}
<div class="articles">
{{ range $index, $element := first 3 $articles }}
{{ $permalink := .Permalink }}
{{ with .Resources.GetMatch "portrait.*" }}
{{ if .RelPermalink }}
<a href="{{ $permalink }}"> <img src="{{ .RelPermalink }}"> </a>
{{ end}}
{{end}}
{{ end }}
Why is there such a difference in the code between getting the pages for a section and a subsection? The difference could be that I am misunderstanding the best way to structure my code or not understanding some of the new developments of Hugo. If this is the case, I would like to understand those new developments.
The section this content belongs to. Note: For nested sections, this is the first path element in the directory, for example, /blog/funny/mypost/ => blog .
So /posts/deeply/nested/lorem.md and /posts/ipsum.md will both have posts as their Section, and both included in:
{{ range where .Site.RegularPages "Section" "posts" }}