Fix "page" not defined

Fixes #10774
This commit is contained in:
Bjørn Erik Pedersen
2023-03-02 09:37:07 +01:00
parent 66f94b4945
commit eef23a7f27
2 changed files with 27 additions and 0 deletions

View File

@@ -83,3 +83,29 @@ post/doesnotexist.html: false
`)
}
// See #10774
func TestPageFunctionExists(t *testing.T) {
t.Parallel()
files := `
-- config.toml --
baseURL = 'http://example.com/'
-- layouts/index.html --
Home: {{ page.IsHome }}
`
b := hugolib.NewIntegrationTestBuilder(
hugolib.IntegrationTestConfig{
T: t,
TxtarString: files,
},
).Build()
b.AssertFileContent("public/index.html", `
Home: true
`)
}