Move all Kind constants to its own package

See #11256
This commit is contained in:
Bjørn Erik Pedersen
2023-07-28 10:53:47 +02:00
parent 5542f02fbc
commit b3cb6788b2
35 changed files with 386 additions and 323 deletions

View File

@@ -17,6 +17,7 @@ import (
"sync"
"github.com/gohugoio/hugo/common/herrors"
"github.com/gohugoio/hugo/resources/kinds"
"github.com/gohugoio/hugo/resources/page"
)
@@ -86,12 +87,12 @@ func (p *pagePaginator) Paginator(options ...any) (*page.Pager, error) {
var pages page.Pages
switch p.source.Kind() {
case page.KindHome:
case kinds.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()
case page.KindTerm, page.KindTaxonomy:
case kinds.KindTerm, kinds.KindTaxonomy:
pages = p.source.Pages()
default:
pages = p.source.RegularPages()