I’d like to list out only the posts under /blog on my site homepage, ignoring subpages under “another-section”. On my index.html template, I have a range that looks like this:
{{ range where .Pages "Section" "blog" }}
<article>
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
</article>
{{ end }}
However, on the homepage of my site, the only thing that gets listed is “Blog,” linking to /blog. This seems like a fairly straightforward range that I saw other people use for this specific purpose, so I’m having trouble understanding where I’ve gone wrong!
And I only want to list out Post 1, Post 2, and Post 3 (without listing Subpost1 and Subpost2)
Then @acanalis solution works, as the other solution will ignore the list page of Post 2, and display all of the subpages under post 2 instead.