diff options
Diffstat (limited to 'hugolib/cascade_test.go')
-rw-r--r-- | hugolib/cascade_test.go | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/hugolib/cascade_test.go b/hugolib/cascade_test.go index 336acdcf3..a112fe10c 100644 --- a/hugolib/cascade_test.go +++ b/hugolib/cascade_test.go @@ -459,4 +459,58 @@ S1|p1:|p2:p2| }) + c.Run("slice with yaml _target", func(c *qt.C) { + b := newBuilder(c) + + b.WithContent("_index.md", `--- +title: "Home" +cascade: +- p1: p1 + _target: + path: "**p1**" +- p2: p2 + _target: + kind: "section" +--- +`) + + b.Build(BuildCfg{}) + + b.AssertFileContent("public/index.html", ` +P1|p1:p1|p2:| +S1|p1:|p2:p2| +`) + + }) + + c.Run("slice with json _target", func(c *qt.C) { + b := newBuilder(c) + + b.WithContent("_index.md", `{ +"title": "Home", +"cascade": [ + { + "p1": "p1", + "_target": { + "path": "**p1**" + } + },{ + "p2": "p2", + "_target": { + "kind": "section" + } + } +] +} +`) + + b.Build(BuildCfg{}) + + b.AssertFileContent("public/index.html", ` + P1|p1:p1|p2:| + S1|p1:|p2:p2| + `) + + }) + } |