aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-05-15 11:59:03 +0200
committerBjørn Erik Pedersen <[email protected]>2024-05-15 12:39:33 +0200
commit39cf906bc0eb59cfc81be0ccd8985a28567e7599 (patch)
tree2487ee5a2ed428dc09a6ee71e4874592d6790a59 /hugolib
parent1aacfced390604eee7fc48eb13b9b45f8399a557 (diff)
downloadhugo-39cf906bc0eb59cfc81be0ccd8985a28567e7599.tar.gz
hugo-39cf906bc0eb59cfc81be0ccd8985a28567e7599.zip
Fix mixed case Page params handling in content adapters
Fixes #12497
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go b/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go
index f09fa3dc1..75283a122 100644
--- a/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go
+++ b/hugolib/pagesfromdata/pagesfromgotmpl_integration_test.go
@@ -494,3 +494,27 @@ disableKinds = ['home','section','rss','sitemap','taxonomy','term']
b.AssertFileExists("public/s-1.2.3/p-4.5.6/index.html", true)
}
+
+func TestPagesFromGoParamsIssue12497(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['home','section','rss','sitemap','taxonomy','term']
+-- content/_content.gotmpl --
+{{ .AddPage (dict "path" "p1" "title" "p1" "params" (dict "paraM1" "param1v" )) }}
+{{ .AddResource (dict "path" "p1/data1.yaml" "content" (dict "value" "data1" ) "params" (dict "paraM1" "param1v" )) }}
+-- layouts/_default/single.html --
+{{ .Title }}|{{ .Params.paraM1 }}
+{{ range .Resources }}
+{{ .Name }}|{{ .Params.paraM1 }}
+{{ end }}
+`
+
+ b := hugolib.Test(t, files)
+
+ b.AssertFileContent("public/p1/index.html",
+ "p1|param1v",
+ "data1.yaml|param1v",
+ )
+}