[Solved] Problem with RegularPages

I have a blog using the no longer supported theme theme-hugo-foundation6. I have a repository of the theme as last updated here https://github.com/billthefarmer/theme-hugo-foundation6. The sources for the blog are here https://github.com/billthefarmer/blog/tree/master/blog. the blog is here https://billthefarmer.github.io/blog. I have fixed a few minor problems with the theme as they were flagged up but the changes introduced in Hugo 0.57 have broken the main page and I can’t work out how to fix it. The baseof.html file contains:

{{ block "main" . }} {{ end }}
{{ partial "sidebar.html" . }}

The list.html file contains:

{{ define "main" }}

{{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}
{{ range $paginator.Pages }}
  {{ .Render "summary" }}
{{ end }}

This works fine for category pages, but not the main page. I realise I should be using site.RegularPages or .Site.RegularPages but I can’t work out where or how.

Homepage’s .Pages only holds root sections, so try this:

{{ $pages := .Pages }}
{{ if .IsHome }}
  {{ $pages = site.RegularPages }}
{{ end }}
{{ $paginator := .Paginate (where $pages "Type" "post") }}
1 Like

Thank you, that works fine