aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/taxonomy_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-02-22 18:22:40 +0100
committerBjørn Erik Pedersen <[email protected]>2020-02-23 00:11:10 +0100
commit0bd6356c6d2a2bac06d0c3705bf13a90cb7a2688 (patch)
treee4a7b814b25edfebb307ade805dbe8aede3eac92 /hugolib/taxonomy_test.go
parentca68abf0bc2fa003c2052143218f7b2ab195a46e (diff)
downloadhugo-0bd6356c6d2a2bac06d0c3705bf13a90cb7a2688.tar.gz
hugo-0bd6356c6d2a2bac06d0c3705bf13a90cb7a2688.zip
Fix panic when home page is drafted
Fixes #6927
Diffstat (limited to 'hugolib/taxonomy_test.go')
-rw-r--r--hugolib/taxonomy_test.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/hugolib/taxonomy_test.go b/hugolib/taxonomy_test.go
index 0e2f0d83d..f8dca6a1f 100644
--- a/hugolib/taxonomy_test.go
+++ b/hugolib/taxonomy_test.go
@@ -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)