hugolib: Add a test for overriding _internal templates

This commit is contained in:
Bjørn Erik Pedersen 2024-08-28 08:17:16 +02:00
parent aa0f66b290
commit 371246de25
No known key found for this signature in database

View file

@ -706,3 +706,17 @@ a: {{ $a }}
b.AssertFileContent("public/index.html", `a: [a b c]`)
}
func TestOverrideInternalTemplate(t *testing.T) {
files := `
-- hugo.toml --
baseURL = "https://example.org"
-- layouts/index.html --
{{ template "_internal/google_analytics_async.html" . }}
-- layouts/_internal/google_analytics_async.html --
Overridden.
`
b := Test(t, files)
b.AssertFileContent("public/index.html", "Overridden.")
}