summaryrefslogtreecommitdiffstats
path: root/hugolib/cascade_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/cascade_test.go')
-rw-r--r--hugolib/cascade_test.go50
1 files changed, 49 insertions, 1 deletions
diff --git a/hugolib/cascade_test.go b/hugolib/cascade_test.go
index d0a6730db..3e3e471b7 100644
--- a/hugolib/cascade_test.go
+++ b/hugolib/cascade_test.go
@@ -892,7 +892,7 @@ disableKinds = ['home','rss','sitemap','taxonomy','term']
---
title: s
cascade:
- _build:
+ build:
render: never
---
-- content/s/p1.md --
@@ -917,3 +917,51 @@ title: p2
b.AssertFileExists("public/sx/index.html", true) // failing
b.AssertFileExists("public/sx/p2/index.html", true) // failing
}
+
+func TestCascadeGotmplIssue13743(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['home','rss','section','sitemap','taxonomy','term']
+[cascade.params]
+foo = 'bar'
+[cascade.target]
+path = '/p1'
+-- content/_content.gotmpl --
+{{ .AddPage (dict "title" "p1" "path" "p1") }}
+-- layouts/all.html --
+{{ .Title }}|{{ .Params.foo }}
+`
+
+ b := Test(t, files)
+
+ b.AssertFileContent("public/p1/index.html", "p1|bar") // actual content is "p1|"
+}
+
+func TestCascadeWarnOverrideIssue13806(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['home','rss','section','sitemap','taxonomy','term']
+[[cascade]]
+[cascade.params]
+searchable = true
+[cascade.target]
+kind = 'page'
+-- content/something.md --
+---
+title: Something
+params:
+ searchable: false
+---
+-- layouts/all.html --
+All.
+
+`
+
+ b := Test(t, files, TestOptWarn())
+
+ b.AssertLogContains("! WARN")
+}