diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-02 18:34:02 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-09-02 18:34:02 +0300 |
commit | 4898fb3d64c856c5e0f324e0dfbf3b60da1d1d3a (patch) | |
tree | ef16a7294e4e550c5ca60b2508481564b3bd4e5d /hugolib/page.go | |
parent | 45d7988f2d0aa95d1a56f4c66342574075cf2963 (diff) |
Make home.Pages work like any other section
Fixes #6240
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index f08e309d4..306ca7b0f 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -146,9 +146,7 @@ func (p *pageState) RegularPages() page.Pages { switch p.Kind() { case page.KindPage: - case page.KindHome: - pages = p.s.RegularPages() - case page.KindSection, page.KindTaxonomyTerm: + case page.KindSection, page.KindHome, page.KindTaxonomyTerm: pages = p.getPages() case page.KindTaxonomy: all := p.Pages() @@ -174,12 +172,7 @@ func (p *pageState) Pages() page.Pages { switch p.Kind() { case page.KindPage: - case page.KindHome: - // See https://github.com/gohugoio/hugo/issues/6238 - // Note: When making the change below, also remember RegularPages. - p.s.DistinctWarningLog.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: + case page.KindSection, page.KindHome: pages = p.getPagesAndSections() case page.KindTaxonomy: termInfo := p.bucket |