tpl: Warn and skip non-hook templates inside /layouts/_markup

Fixes #13577
This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 15:57:29 +02:00
parent 653f1c1d46
commit 383dd82f95
3 changed files with 39 additions and 5 deletions

View File

@@ -844,6 +844,21 @@ All.
b.AssertLogContains("Duplicate content path")
}
// Issue #13577.
func TestPrintPathWarningOnInvalidMarkupFilename(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
-- layouts/all.html --
All.
-- layouts/_markup/sitemap.xml --
`
b := hugolib.Test(t, files, hugolib.TestOptWarn())
b.AssertLogContains("unrecognized render hook")
}
func BenchmarkExecuteWithContext(b *testing.B) {
files := `
-- hugo.toml --