diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-17 12:59:41 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-08-17 13:06:39 +0200 |
commit | ab40ce679f1679d76f47652711fc30348a2efafd (patch) | |
tree | ac825b6938b43ab4bb0bd395e74d8b1905adf14d /hugolib/page.go | |
parent | 416493b548a9bbaa27758fba9bab50a22b680e9d (diff) |
Revert the 0.57 home.Pages change
In 0.57 we change the behaviour of home.Pages to be in line with the other sections. This has created a lot noise and breakage in the wild.
This commit reverts that change, but adds a warning that we will change this in 0.58 and that you should consider using .Site.RegularPages if that is what you want.
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 306ca7b0f..f8f6741d2 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -146,7 +146,9 @@ func (p *pageState) RegularPages() page.Pages { switch p.Kind() { case page.KindPage: - case page.KindSection, page.KindHome, page.KindTaxonomyTerm: + case page.KindHome: + pages = p.s.RegularPages() + case page.KindSection, page.KindTaxonomyTerm: pages = p.getPages() case page.KindTaxonomy: all := p.Pages() @@ -172,7 +174,12 @@ func (p *pageState) Pages() page.Pages { switch p.Kind() { case page.KindPage: - case page.KindSection, page.KindHome: + case page.KindHome: + // See https://github.com/gohugoio/hugo/issues/6238 + // Note: When making the change below, also remember RegularPages. + helpers.DistinctWarnLog.Println(`In the next Hugo version (0.58.0) we will change how $home.Pages behaves. If you want to list all regular pages, replace .Pages or .Data.Pages with .Site.RegularPages in your home page template.`) + pages = p.s.RegularPages() + case page.KindSection: pages = p.getPagesAndSections() case page.KindTaxonomy: termInfo := p.bucket |