Alias Page.Scratch to Page.Store (note)

Fixes #13016
This commit is contained in:
Bjørn Erik Pedersen
2024-11-05 16:32:57 +01:00
parent df8bd4af4f
commit 2c3efc8106
6 changed files with 35 additions and 24 deletions

View File

@@ -1688,6 +1688,32 @@ title: Scratch Me!
b.AssertFileContent("public/scratchme/index.html", "C: cv")
}
// Issue 13016.
func TestScratchAliasToStore(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ["taxonomy", "term", "page", "section"]
disableLiveReload = true
-- layouts/index.html --
{{ .Scratch.Set "a" "b" }}
{{ .Store.Set "c" "d" }}
.Scratch eq .Store: {{ eq .Scratch .Store }}
a: {{ .Store.Get "a" }}
c: {{ .Scratch.Get "c" }}
`
b := Test(t, files)
b.AssertFileContent("public/index.html",
".Scratch eq .Store: true",
"a: b",
"c: d",
)
}
func TestPageParam(t *testing.T) {
t.Parallel()