Fix recent regression with cascading of params to content adapters

Fixes #13743
This commit is contained in:
Bjørn Erik Pedersen
2025-05-26 18:12:32 +02:00
parent 9ad26b69ad
commit eaf5ace30d
7 changed files with 82 additions and 72 deletions

View File

@@ -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|"
}