mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Reimplement and simplify Hugo's template system
See #13541 for details. Fixes #13545 Fixes #13515 Closes #7964 Closes #13365 Closes #12988 Closes #4891
This commit is contained in:
@@ -242,8 +242,13 @@ Data en
|
||||
}
|
||||
|
||||
func TestBundleMultipleContentPageWithSamePath(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
printPathWarnings = true
|
||||
-- layouts/all.html --
|
||||
All.
|
||||
-- content/bundle/index.md --
|
||||
---
|
||||
title: "Bundle md"
|
||||
@@ -273,14 +278,18 @@ Bundle: {{ $bundle.Title }}|{{ $bundle.Params.foo }}|{{ $bundle.File.Filename }}
|
||||
P1: {{ $p1.Title }}|{{ $p1.Params.foo }}|{{ $p1.File.Filename }}|
|
||||
`
|
||||
|
||||
b := Test(t, files)
|
||||
for range 3 {
|
||||
b := Test(t, files, TestOptWarn())
|
||||
|
||||
// There's multiple content files sharing the same logical path and language.
|
||||
// This is a little arbitrary, but we have to pick one and prefer the Markdown version.
|
||||
b.AssertFileContent("public/index.html",
|
||||
filepath.FromSlash("Bundle: Bundle md|md|/content/bundle/index.md|"),
|
||||
filepath.FromSlash("P1: P1 md|md|/content/p1.md|"),
|
||||
)
|
||||
b.AssertLogContains("WARN Duplicate content path: \"/p1\"")
|
||||
|
||||
// There's multiple content files sharing the same logical path and language.
|
||||
// This is a little arbitrary, but we have to pick one and prefer the Markdown version.
|
||||
b.AssertFileContent("public/index.html",
|
||||
filepath.FromSlash("Bundle: Bundle md|md|/content/bundle/index.md|"),
|
||||
filepath.FromSlash("P1: P1 md|md|/content/p1.md|"),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Issue #11944
|
||||
|
Reference in New Issue
Block a user