mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Add Sections to Site interface
See https://github.com/gohugoio/hugo/issues/10947#issuecomment-1550012671 Updates #10947
This commit is contained in:
@@ -741,3 +741,30 @@ themeconfigdirparam: {{ site.Params.themeconfigdirparam }}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO(beo) find a better place for this.
|
||||
func TestReproCommentsIn10947(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
baseURL = "https://example.com"
|
||||
-- content/mysection/_index.md --
|
||||
---
|
||||
title: "My Section"
|
||||
---
|
||||
-- layouts/index.html --
|
||||
Sections: {{ if site.Sections }}true{{ end }}|
|
||||
|
||||
|
||||
`
|
||||
b := NewIntegrationTestBuilder(
|
||||
IntegrationTestConfig{
|
||||
T: t,
|
||||
TxtarString: files,
|
||||
},
|
||||
).Build()
|
||||
|
||||
b.AssertFileContent("public/index.html", "Sections: true|")
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user