With reference to this topic. My pagination logic is like this in the list template (which renders the homepage and list pages).
Summary
{{/* Set Pages */}}
{{- $pages := .Pages }}
{{- if .IsHome }}
{{- $p := slice }}
{{- range (where site.Pages "Type" "post").ByDate }}
{{- if or
(and .IsPage (not (eq .Layout "multipage" )))
(and .IsSection (eq .Layout "multipage" ))
-}}
{{- $p = $p | append . }}
{{- end }}
{{- end }}
{{- $pages = $p.ByDate.Reverse }}
{{- end }}
{{/* Set constants. */}}
{{- $numFeaturedPages := 2 }}
{{- $numPagesFirstPager := 14 }}
{{- $numPagesSubsequentPagers := 12 }}
{{- $paginator := .Paginate ($pages | after (sub $numPagesFirstPager $numPagesSubsequentPagers)) $numPagesSubsequentPagers -}}
The rest of the layout is defined in this solution.
So, in the head template, I have to this
Summary
{{- $numFeaturedPages := 2 }}
{{- $numPagesFirstPager := 14 }}
{{- $numPagesSubsequentPagers := 12 }}
{{- $paginator := "" -}}
{{- $pages := .Pages }}
{{- if and (.IsSection) (ne .Layout "multipage") -}}
{{- $paginator = .Paginate ($pages| after (sub $numPagesFirstPager $numPagesSubsequentPagers)) $numPagesSubsequentPagers }}
{{- end }}
{{- if .IsHome }}
{{- $p := slice }}
{{- range (where site.Pages "Type" "post").ByDate }}
{{- if or
(and .IsPage (not (eq .Layout "multipage" )))
(and .IsSection (eq .Layout "multipage" ))
-}}
{{- $p = $p | append . }}
{{- end }}
{{- end }}
{{- $pages = $p.ByDate.Reverse }}
{{- $paginator = .Paginate ($pages | after (sub $numPagesFirstPager $numPagesSubsequentPagers)) $numPagesSubsequentPagers -}}
{{- end }}
So, how to use the ‘new’ implementation with this logic? cc @jmooring