I have a site structure that looks like this:
_index.md
-/blog
-_index.md
-post1.md
-post2.md
-/another-section
-subpage1.md
-subpage2.md
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!
If you’d like to see what’s happening live, my site is https://samlinville.com and the repo is at https://github.com/samlinville/hugo-sammy