all: Replace _build with build in tests

_build is deprecated and now shows up as warning.
This commit is contained in:
Bjørn Erik Pedersen
2025-06-02 12:44:06 +02:00
parent 32af02cd3e
commit 32eb1a8ad4
5 changed files with 13 additions and 14 deletions

View File

@@ -892,7 +892,7 @@ disableKinds = ['home','rss','sitemap','taxonomy','term']
--- ---
title: s title: s
cascade: cascade:
_build: build:
render: never render: never
--- ---
-- content/s/p1.md -- -- content/s/p1.md --

View File

@@ -44,14 +44,14 @@ tags: ["mytag"]
`, "sect/no-list.md", ` `, "sect/no-list.md", `
--- ---
title: No List title: No List
_build: build:
list: false list: false
--- ---
`, "sect/no-render.md", ` `, "sect/no-render.md", `
--- ---
title: No List title: No List
_build: build:
render: false render: false
--- ---
`, `,
@@ -59,14 +59,14 @@ _build:
--- ---
title: No Render Link title: No Render Link
aliases: ["/link-alias"] aliases: ["/link-alias"]
_build: build:
render: link render: link
--- ---
`, `,
"sect/no-publishresources/index.md", ` "sect/no-publishresources/index.md", `
--- ---
title: No Publish Resources title: No Publish Resources
_build: build:
publishResources: false publishResources: false
--- ---
@@ -81,7 +81,7 @@ headless: true
--- ---
title: Headless Local Lists title: Headless Local Lists
cascade: cascade:
_build: build:
render: false render: false
list: local list: local
publishResources: false publishResources: false
@@ -365,7 +365,7 @@ Data1: {{ $data1.RelPermalink }}
`) `)
b.WithContent("section/bundle-false/index.md", `---\ntitle: BundleFalse b.WithContent("section/bundle-false/index.md", `---\ntitle: BundleFalse
_build: build:
publishResources: false publishResources: false
---`, ---`,
"section/bundle-false/data1.json", "Some data1", "section/bundle-false/data1.json", "Some data1",
@@ -388,7 +388,7 @@ func TestNoRenderAndNoPublishResources(t *testing.T) {
noRenderPage := ` noRenderPage := `
--- ---
title: %s title: %s
_build: build:
render: false render: false
publishResources: false publishResources: false
--- ---

View File

@@ -57,7 +57,7 @@ Summary: {{ .Summary }}|
) )
} }
func TestFrontMatterParamsKindPath(t *testing.T) { func TestFrontMatterParamsPath(t *testing.T) {
t.Parallel() t.Parallel()
files := ` files := `
@@ -72,10 +72,9 @@ date: 2019-08-07
path: "/a/b/c" path: "/a/b/c"
slug: "s1" slug: "s1"
--- ---
-- content/mysection.md -- -- content/mysection/_index.md --
--- ---
title: "My Section" title: "My Section"
kind: "section"
date: 2022-08-07 date: 2022-08-07
path: "/a/b" path: "/a/b"
--- ---

View File

@@ -615,7 +615,7 @@ var weightedPage5 = `+++
weight = "5" weight = "5"
title = "Five" title = "Five"
[_build] [build]
render = "never" render = "never"
+++ +++
Front Matter with Ordered Pages 5` Front Matter with Ordered Pages 5`

View File

@@ -31,7 +31,7 @@ func TestDecodeBuildConfig(t *testing.T) {
c := qt.New(t) c := qt.New(t)
configTempl := ` configTempl := `
[_build] [build]
render = %s render = %s
list = %s list = %s
publishResources = true` publishResources = true`
@@ -82,7 +82,7 @@ publishResources = true`
} { } {
cfg, err := config.FromConfigString(fmt.Sprintf(configTempl, test.args...), "toml") cfg, err := config.FromConfigString(fmt.Sprintf(configTempl, test.args...), "toml")
c.Assert(err, qt.IsNil) c.Assert(err, qt.IsNil)
bcfg, err := DecodeBuildConfig(cfg.Get("_build")) bcfg, err := DecodeBuildConfig(cfg.Get("build"))
c.Assert(err, qt.IsNil) c.Assert(err, qt.IsNil)
eq := qt.CmpEquals(hqt.DeepAllowUnexported(BuildConfig{})) eq := qt.CmpEquals(hqt.DeepAllowUnexported(BuildConfig{}))