mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Fix recent regression with cascading of params to content adapters
Fixes #13743
This commit is contained in:
@@ -917,3 +917,24 @@ 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|"
|
||||
}
|
||||
|
Reference in New Issue
Block a user