mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
pagemeta: Make BuildConfig.Render an enum
Allowing links on pages without rendering them. Fixes #7783
This commit is contained in:
@@ -54,7 +54,15 @@ title: No List
|
||||
_build:
|
||||
render: false
|
||||
---
|
||||
`, "sect/no-publishresources/index.md", `
|
||||
`,
|
||||
"sect/no-render-link.md", `
|
||||
---
|
||||
title: No Render Link
|
||||
_build:
|
||||
render: link
|
||||
---
|
||||
`,
|
||||
"sect/no-publishresources/index.md", `
|
||||
---
|
||||
title: No Publish Resources
|
||||
_build:
|
||||
@@ -303,6 +311,20 @@ title: Headless Local Lists Sub
|
||||
b.Assert(getPageInPagePages(sect, ref), qt.Not(qt.IsNil))
|
||||
})
|
||||
|
||||
c.Run("Build config, no render link", func(c *qt.C) {
|
||||
b := newSitesBuilder(c, disableKind)
|
||||
b.Build(BuildCfg{})
|
||||
ref := "/sect/no-render-link.md"
|
||||
b.Assert(b.CheckExists("public/sect/no-render/index.html"), qt.Equals, false)
|
||||
p := getPage(b, ref)
|
||||
b.Assert(p, qt.Not(qt.IsNil))
|
||||
b.Assert(p.RelPermalink(), qt.Equals, "/blog/sect/no-render-link/")
|
||||
b.Assert(p.OutputFormats(), qt.HasLen, 0)
|
||||
b.Assert(getPageInSitePages(b, ref), qt.Not(qt.IsNil))
|
||||
sect := getPage(b, "/sect")
|
||||
b.Assert(getPageInPagePages(sect, ref), qt.Not(qt.IsNil))
|
||||
})
|
||||
|
||||
c.Run("Build config, no publish resources", func(c *qt.C) {
|
||||
b := newSitesBuilder(c, disableKind)
|
||||
b.Build(BuildCfg{})
|
||||
|
Reference in New Issue
Block a user