Add environment as a new filter to _cascade.target

Fixes #9612
This commit is contained in:
Cathrine Paulsen
2022-04-05 07:41:24 +00:00
committed by GitHub
parent ed9aa374dd
commit da00e7714e
5 changed files with 58 additions and 2 deletions

View File

@@ -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)