diff --git a/hugolib/hugo_smoke_test.go b/hugolib/hugo_smoke_test.go index 539e79729..2121738a9 100644 --- a/hugolib/hugo_smoke_test.go +++ b/hugolib/hugo_smoke_test.go @@ -193,7 +193,7 @@ Some **Markdown** in JSON shortcode. b.AssertFileContent("public/index.html", "home|In English", "Site params: Rules", - "Pages: Pages(6)|Data Pages: Pages(6)", + "Pages: Pages(18)|Data Pages: Pages(18)", "Paginator: 1", "First Site: In English", "RelPermalink: /", 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