I’m doing it this way (the new way) with gallery items on my site. I was previously setting them to headless and using readDir , but I wanted to paginate them, and pagination only works with an actual Pages collection:
My gallery’s _index.html looks like this, to make all the gallery items get listed but for no physical pages to get generated for them:
+++
title = "Gallery"
layout = "gallery"
[_build]
render = "always"
[cascade._build]
render = "never"
list = "local"
+++
<p>Photo gallery for this site.</p>
Note that in the above front matter, I’m setting list = "local" , which works for my use case, but might not work for all use cases (i.e. if you want to list the “no render” items anywhere else on the site, other than on their parent page). At the moment, if you set list = "always" , then a whole lot of empty items get added to the sitemap (because “no render” items have no permalink). I’ve submitted a bug fix for this at Sitemap: exclude "no render" pages by Jaza · Pull Request #8201 · gohugoio/hugo · GitHub . Once that gets in, it should be safe to set list = "always" if you need to.