mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Handle build vs _build in front matter
* Throw a detailed error message in the mentioned case * Also fixed a dropped error Fixes #11970
This commit is contained in:
@@ -181,3 +181,24 @@ lang = 'nn'
|
||||
b, err := TestE(t, files)
|
||||
b.Assert(err, qt.IsNotNil)
|
||||
}
|
||||
|
||||
// Issue 11970.
|
||||
func TestFrontMatterBuildIsHugoKeyword(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
baseURL = "https://example.org/"
|
||||
-- content/p1.md --
|
||||
---
|
||||
title: "P1"
|
||||
build: "foo"
|
||||
---
|
||||
-- layouts/_default/single.html --
|
||||
Params: {{ range $k, $v := .Params }}{{ $k }}: {{ $v }}|{{ end }}$
|
||||
`
|
||||
b, err := TestE(t, files)
|
||||
|
||||
b.Assert(err, qt.IsNotNil)
|
||||
b.Assert(err.Error(), qt.Contains, "We renamed the _build keyword")
|
||||
}
|
||||
|
Reference in New Issue
Block a user