Allow cascade to be a slice with a _target discriminator

Fixes #7782
This commit is contained in:
Bjørn Erik Pedersen
2020-10-05 20:01:52 +02:00
parent 5e2a547cb5
commit c63db7f1f6
11 changed files with 375 additions and 29 deletions

View File

@@ -1757,3 +1757,24 @@ $$$
`<pre><code class="language-bash {hl_lines=[1]}" data-lang="bash {hl_lines=[1]}">SHORT`,
)
}
func TestPageCaseIssues(t *testing.T) {
t.Parallel()
b := newTestSitesBuilder(t)
b.WithConfigFile("toml", `defaultContentLanguage = "no"
[languages]
[languages.NO]
title = "Norsk"
`)
b.WithContent("a/B/C/Page1.md", "---\ntitle: Page1\n---")
b.WithTemplates("index.html", `
{{ $p1 := site.GetPage "a/B/C/Page1" }}
Lang: {{ .Lang }}
Page1: {{ $p1.Path }}
`)
b.Build(BuildCfg{})
b.AssertFileContent("public/index.html", "Lang: no", filepath.FromSlash("Page1: a/B/C/Page1.md"))
}