I am at a point where I probably miss the forest because of all the trees in front of me…
I have a partial that should (and did at some point in the past) range through my main sections (a blog). Now it stopped and is ranging through all published pages.
{{- $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) -}}
<h2 class="visually-hidden">
Recent Posts (Page {{ $paginator.PageNumber -}})
</h2>
{{- $fullcontent := false -}}
{{- if (eq $.Kind "page") -}}
{{- $fullcontent = true -}}
{{- end -}}
{{- range $index, $item := $paginator.Pages -}}
{{- $post := dict "context" $item "fullcontent" $fullcontent -}}
{{- $col := "6" -}}
{{- if eq $index 0 -}}
{{- $col = "12" -}}
{{- end -}}
<div class="col-12 col-md-{{ $col }} mb-4">
{{- partial "content/post.html" $post $post -}}
</div>
{{- end -}}
site.Params.mainSections
is ["blog"]
. The page itself though shows my contacts page and the 404 page which are NOT in the blog-folder.
I debugged the site.Params.mainSections
and it shows as "blog"
, so it’s at the right spot in the config.
This whole behaviour started around “the holidays” and I am not sure if I changed anything important around that time. git blame
certainly does not uncover evidence.
The repo is public, in case somebody wants a deep dive.
What might be the problem here?
Edit: The partial above is the only location in my layouts to use $paginator
or .Paginate
.