mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
@@ -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/math"
|
||||||
_ "github.com/gohugoio/hugo/tpl/openapi/openapi3"
|
_ "github.com/gohugoio/hugo/tpl/openapi/openapi3"
|
||||||
_ "github.com/gohugoio/hugo/tpl/os"
|
_ "github.com/gohugoio/hugo/tpl/os"
|
||||||
|
_ "github.com/gohugoio/hugo/tpl/page"
|
||||||
_ "github.com/gohugoio/hugo/tpl/partials"
|
_ "github.com/gohugoio/hugo/tpl/partials"
|
||||||
_ "github.com/gohugoio/hugo/tpl/path"
|
_ "github.com/gohugoio/hugo/tpl/path"
|
||||||
_ "github.com/gohugoio/hugo/tpl/reflect"
|
_ "github.com/gohugoio/hugo/tpl/reflect"
|
||||||
|
Reference in New Issue
Block a user