hugolib: Fix 2 Paginator.Pages taxonomy regressions

Fixes #6921
Fixes #6918
This commit is contained in:
Bjørn Erik Pedersen
2020-02-20 14:03:56 +01:00
parent a70bbd0696
commit 7ef5a4c83e
2 changed files with 18 additions and 8 deletions

View File

@@ -82,14 +82,19 @@ func (p *pagePaginator) Paginator(options ...interface{}) (*page.Pager, error) {
pd.Type = p.source.outputFormat()
var pages page.Pages
if p.source.IsHome() {
switch p.source.Kind() {
case page.KindHome:
// From Hugo 0.57 we made home.Pages() work like any other
// section. To avoid the default paginators for the home page
// changing in the wild, we make this a special case.
pages = p.source.s.RegularPages()
} else {
case page.KindTaxonomy, page.KindTaxonomyTerm:
pages = p.source.Pages()
default:
pages = p.source.RegularPages()
}
paginator, err := page.Paginate(pd, pages, pagerSize)
if err != nil {
initErr = err