Skip to content
Permalink
Browse files

Make home.Pages work like any other section

Fixes #6240
  • Loading branch information...
bep committed Sep 2, 2019
1 parent 45d7988 commit 4898fb3d64c856c5e0f324e0dfbf3b60da1d1d3a
Showing with 3 additions and 10 deletions.
  1. +1 −1 hugolib/hugo_smoke_test.go
  2. +2 −9 hugolib/page.go
@@ -193,7 +193,7 @@ Some **Markdown** in JSON shortcode.
b.AssertFileContent("public/index.html",
"home|In English",
"Site params: Rules",
"Pages: Pages(18)|Data Pages: Pages(18)",
"Pages: Pages(6)|Data Pages: Pages(6)",
"Paginator: 1",
"First Site: In English",
"RelPermalink: /",
@@ -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

0 comments on commit 4898fb3

Please sign in to comment.
You can’t perform that action at this time.