summaryrefslogtreecommitdiffstats
path: root/hugolib/pagecollections.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-07-28 10:53:47 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-07-28 15:14:23 +0200
commitb3cb6788b2634a89ae774895f345f082020b52d8 (patch)
tree08eadc21d9308510e332a4898d2c06516cb6e497 /hugolib/pagecollections.go
parent5542f02fbc4c9467a4338ee1ce2e741f480a0751 (diff)
Move all Kind constants to its own package
See #11256
Diffstat (limited to 'hugolib/pagecollections.go')
-rw-r--r--hugolib/pagecollections.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/pagecollections.go b/hugolib/pagecollections.go
index b49669bb6..26da4905e 100644
--- a/hugolib/pagecollections.go
+++ b/hugolib/pagecollections.go
@@ -26,6 +26,7 @@ import (
"github.com/gohugoio/hugo/helpers"
+ "github.com/gohugoio/hugo/resources/kinds"
"github.com/gohugoio/hugo/resources/page"
)
@@ -92,7 +93,7 @@ func newPageCollections(m *pageMap) *PageCollections {
})
c.regularPages = newLazyPagesFactory(func() page.Pages {
- return c.findPagesByKindIn(page.KindPage, c.pages.get())
+ return c.findPagesByKindIn(kinds.KindPage, c.pages.get())
})
return c
@@ -120,10 +121,10 @@ func (c *PageCollections) getPageOldVersion(ref ...string) (page.Page, error) {
return nil, fmt.Errorf(`too many arguments to .Site.GetPage: %v. Use lookups on the form {{ .Site.GetPage "/posts/mypage-md" }}`, ref)
}
- if len(refs) == 0 || refs[0] == page.KindHome {
+ if len(refs) == 0 || refs[0] == kinds.KindHome {
key = "/"
} else if len(refs) == 1 {
- if len(ref) == 2 && refs[0] == page.KindSection {
+ if len(ref) == 2 && refs[0] == kinds.KindSection {
// This is an old style reference to the "Home Page section".
// Typically fetched via {{ .Site.GetPage "section" .Section }}
// See https://github.com/gohugoio/hugo/issues/4989