Skip to content

Commit 32eb1a8

Browse files
committed
all: Replace _build with build in tests
_build is deprecated and now shows up as warning.
1 parent 32af02c commit 32eb1a8

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

hugolib/cascade_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ disableKinds = ['home','rss','sitemap','taxonomy','term']
892892
---
893893
title: s
894894
cascade:
895-
_build:
895+
build:
896896
render: never
897897
---
898898
-- content/s/p1.md --

hugolib/disableKinds_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,29 @@ tags: ["mytag"]
4444
`, "sect/no-list.md", `
4545
---
4646
title: No List
47-
_build:
47+
build:
4848
list: false
4949
---
5050
5151
`, "sect/no-render.md", `
5252
---
5353
title: No List
54-
_build:
54+
build:
5555
render: false
5656
---
5757
`,
5858
"sect/no-render-link.md", `
5959
---
6060
title: No Render Link
6161
aliases: ["/link-alias"]
62-
_build:
62+
build:
6363
render: link
6464
---
6565
`,
6666
"sect/no-publishresources/index.md", `
6767
---
6868
title: No Publish Resources
69-
_build:
69+
build:
7070
publishResources: false
7171
---
7272
@@ -81,7 +81,7 @@ headless: true
8181
---
8282
title: Headless Local Lists
8383
cascade:
84-
_build:
84+
build:
8585
render: false
8686
list: local
8787
publishResources: false
@@ -365,7 +365,7 @@ Data1: {{ $data1.RelPermalink }}
365365
`)
366366

367367
b.WithContent("section/bundle-false/index.md", `---\ntitle: BundleFalse
368-
_build:
368+
build:
369369
publishResources: false
370370
---`,
371371
"section/bundle-false/data1.json", "Some data1",
@@ -388,7 +388,7 @@ func TestNoRenderAndNoPublishResources(t *testing.T) {
388388
noRenderPage := `
389389
---
390390
title: %s
391-
_build:
391+
build:
392392
render: false
393393
publishResources: false
394394
---

hugolib/params_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Summary: {{ .Summary }}|
5757
)
5858
}
5959

60-
func TestFrontMatterParamsKindPath(t *testing.T) {
60+
func TestFrontMatterParamsPath(t *testing.T) {
6161
t.Parallel()
6262

6363
files := `
@@ -72,10 +72,9 @@ date: 2019-08-07
7272
path: "/a/b/c"
7373
slug: "s1"
7474
---
75-
-- content/mysection.md --
75+
-- content/mysection/_index.md --
7676
---
7777
title: "My Section"
78-
kind: "section"
7978
date: 2022-08-07
8079
path: "/a/b"
8180
---

hugolib/site_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ var weightedPage5 = `+++
615615
weight = "5"
616616
title = "Five"
617617
618-
[_build]
618+
[build]
619619
render = "never"
620620
+++
621621
Front Matter with Ordered Pages 5`

resources/page/pagemeta/pagemeta_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestDecodeBuildConfig(t *testing.T) {
3131
c := qt.New(t)
3232

3333
configTempl := `
34-
[_build]
34+
[build]
3535
render = %s
3636
list = %s
3737
publishResources = true`
@@ -82,7 +82,7 @@ publishResources = true`
8282
} {
8383
cfg, err := config.FromConfigString(fmt.Sprintf(configTempl, test.args...), "toml")
8484
c.Assert(err, qt.IsNil)
85-
bcfg, err := DecodeBuildConfig(cfg.Get("_build"))
85+
bcfg, err := DecodeBuildConfig(cfg.Get("build"))
8686
c.Assert(err, qt.IsNil)
8787

8888
eq := qt.CmpEquals(hqt.DeepAllowUnexported(BuildConfig{}))

0 commit comments

Comments
 (0)