mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
ca68abf0bc
commit
0bd6356c6d
2 changed files with 50 additions and 0 deletions
|
@ -719,6 +719,12 @@ func (m *pageMaps) AssemblePages() error {
|
|||
return err
|
||||
}
|
||||
|
||||
if pm.s.home == nil {
|
||||
// Home is disabled, everything is.
|
||||
pm.bundleTrees.DeletePrefix("")
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := pm.assembleTaxonomies(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -401,6 +401,50 @@ Content.
|
|||
|
||||
}
|
||||
|
||||
// https://github.com/gohugoio/hugo/issues/6927
|
||||
func TestTaxonomiesHomeDraft(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
b := newTestSitesBuilder(t)
|
||||
b.WithContent(
|
||||
"_index.md", `---
|
||||
title: "Home"
|
||||
draft: true
|
||||
---
|
||||
|
||||
Content.
|
||||
|
||||
`,
|
||||
"posts/_index.md", `---
|
||||
title: "Posts"
|
||||
draft: true
|
||||
---
|
||||
|
||||
Content.
|
||||
|
||||
`,
|
||||
"posts/page.md", `---
|
||||
title: "The Page"
|
||||
categories: ["cool"]
|
||||
---
|
||||
|
||||
Content.
|
||||
|
||||
`,
|
||||
)
|
||||
|
||||
b.WithTemplates("index.html", `
|
||||
NO HOME FOR YOU
|
||||
`)
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
|
||||
b.Assert(b.CheckExists("public/index.html"), qt.Equals, false)
|
||||
b.Assert(b.CheckExists("public/categories/index.html"), qt.Equals, false)
|
||||
b.Assert(b.CheckExists("public/posts/index.html"), qt.Equals, false)
|
||||
|
||||
}
|
||||
|
||||
// https://github.com/gohugoio/hugo/issues/6173
|
||||
func TestTaxonomiesWithBundledResources(t *testing.T) {
|
||||
b := newTestSitesBuilder(t)
|
||||
|
|
Loading…
Reference in a new issue