This is: /layouts/index.html:
{{ define "main" }}
{{.Content}}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "post") }}
We have {{ $paginator.TotalPages }} pages.
<br/>
{{ range $paginator.Pages }}
<span class="article-title">{{ .Page.Title -}}</span>
<span class="article-topics">{{ partial "taglist.html" . -}}</span>
<div class="article-meta">
by {{ .Params.author }} ({{ .Page.Date }})
</div>
<p>
<span class="article">{{ .Page.Summary }}</article>
</p>
<a href="{{ .Page.Permalink }}">Read more</a>
<hr/>
{{ end }}
Page {{ $paginator.PageNumber }} of {{ $paginator.TotalPages }} pages.
{{ if ne $paginator.PageNumber $paginator.First.PageNumber }}
[<a href="{{ $paginator.First.URL }}">First</a>]
{{ end }}
{{ if $paginator.HasPrev }}
[<a href="{{ $paginator.Prev.URL }}">Previous</a>]
{{ end }}
{{ if $paginator.HasNext }}
[<a href="{{ $paginator.Next.URL }}">Next</a>]
{{ end }}
{{ if ne $paginator.PageNumber $paginator.Last.PageNumber }}
[<a href="{{ $paginator.Last.URL }}">Last</a>]
{{ end }}
{{ end }}
There are 113 pages with type: “post”, and 10 pages with type: “base”. Front matter has paginate = 5.
On first iteration, TotalPages is 23. But as soon as you move to any of the other pages, TotalPages is 25. AND, the displayed pages include the “base” pages.
Any help would be appreciated.