Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCathrine Paulsen <c.r.paulsen@student.tudelft.nl>2022-04-05 10:41:24 +0300
committerGitHub <noreply@github.com>2022-04-05 10:41:24 +0300
commitda00e7714e0233d5cba73bc3c4cf7331304ccb20 (patch)
tree65609a1e27b98a5a5cc02426ef1c6ec4955c7265 /hugolib
parented9aa374dd5e18fbfb207a0a10cde2362061c8ca (diff)
Add environment as a new filter to _cascade.target
Fixes #9612
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/cascade_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/hugolib/cascade_test.go b/hugolib/cascade_test.go
index c218aa282..0a7f66e6c 100644
--- a/hugolib/cascade_test.go
+++ b/hugolib/cascade_test.go
@@ -550,6 +550,32 @@ S1|p1:|p2:p2|
`)
})
+ c.Run("slice with environment _target", func(c *qt.C) {
+ b := newBuilder(c)
+
+ b.WithContent("_index.md", `+++
+title = "Home"
+[[cascade]]
+p1 = "p1"
+[cascade._target]
+path="**p1**"
+environment="testing"
+[[cascade]]
+p2 = "p2"
+[cascade._target]
+kind="section"
+environment="production"
++++
+`)
+
+ b.Build(BuildCfg{})
+
+ b.AssertFileContent("public/index.html", `
+P1|p1:|p2:|
+S1|p1:|p2:p2|
+`)
+ })
+
c.Run("slice with yaml _target", func(c *qt.C) {
b := newBuilder(c)