Confused about .Site.Pages vs .Site.RegularPages

I have a bunch of hugo sites that were running on older versions about a year old (as well as my dev environment) and just updated to the current stable yesterday.

In many of the various “Sections” I use I list those on other pages via

range where .Site.Pages "Section" "whatever"

After the update to 0.55.6 most of those still work fine and list all the pages in the section but some work differently in that they include what seems to be the list page for that section. In other words if I use where .Site.Pages “Section” “blog” I get an extra page at the beginning titled “Blogs”. There is no in that section and I do not get the same thing with other sections on the same site.

I needed to change .Site.Pages to .Site.RegularPages.

I guess I have two questions…

  1. Why does content in one section behave differently than what is an identical section in this case section “blog” vs “team” the only difference in the query is I use first 3 with the blog section and do not with the team section. The content is structured identically.

  2. When exactly did this change as my not particularly crazy old produciton version of hugo did not behave this way.

Thanks in advance

  1. .Pages includes ALL pages in your selection, meaning also the list page (which is the “blogs” page that turned up) and pages that you might hide (maybe via headless: true). .RegularPages is basically a collector for “regular” blog posts.

  2. “Recently”. I had the same issues for some weeks and your solution is the right one.

1 Like

Check out these docs if you haven’t already: