Hide Section in List


I am trying to create a list on my website homepage, that lists pages from 2 sections. I have this working, but unfortunately I cant work out how to hide the section titles.

here is my code:
{{ $paginator := .Paginate (where .Site.Pages “Type” “in” “post, newsletter”) }}
{{ range $paginator.Pages.ByPublishDate.Reverse }}
{{ partial “list-stub.html” . }}
{{ end }}

but in the list, I get two sections listed posts/ and newsletter, rather than just displaying the markdown file links underneath these sections.

Hope someone can help!


Use .Site.RegularPages instead.

See https://gohugo.io/variables/site/#sitepages-compared-to-pages.


Thanks jmooring,

I just spotted this in the docs and tried it and it works. Im pretty sure I tried this before and it didn’t, but my mistake!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.