mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
66f94b4945
commit
eef23a7f27
2 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
|
||||
`)
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ import (
|
|||
_ "github.com/gohugoio/hugo/tpl/math"
|
||||
_ "github.com/gohugoio/hugo/tpl/openapi/openapi3"
|
||||
_ "github.com/gohugoio/hugo/tpl/os"
|
||||
_ "github.com/gohugoio/hugo/tpl/page"
|
||||
_ "github.com/gohugoio/hugo/tpl/partials"
|
||||
_ "github.com/gohugoio/hugo/tpl/path"
|
||||
_ "github.com/gohugoio/hugo/tpl/reflect"
|
||||
|
|
Loading…
Reference in a new issue