-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
Description
The test below passes with v0.145.0 and earlier, and fails with v0.146.0 and later:
// Issue 13993
func TestIssue13993(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['home','rss','section','sitemap','taxonomy','term']
printPathWarnings = true
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = true
[languages.en]
contentDir = "content/en"
weight = 1
[languages.es]
contentDir = "content/es"
weight = 2
# Default content mounts
[[module.mounts]]
source = "content/en"
target = "content"
lang = "en"
[[module.mounts]]
source = "content/es"
target = "content"
lang = "es"
# Populate the missing es content with en content
[[module.mounts]]
source = "content/en"
target = "content"
lang = "es"
-- layouts/all.html --
{{ .Title }}
-- content/en/p1.md --
---
title: p1 (en)
---
-- content/en/p2.md --
---
title: p2 (en)
---
-- content/es/p1.md --
---
title: p1 (es)
---
`
b := Test(t, files, TestOptWarn())
b.AssertFileExists("public/en/p1/index.html", true)
b.AssertFileExists("public/en/p2/index.html", true)
b.AssertFileExists("public/es/p1/index.html", true)
b.AssertFileExists("public/es/p2/index.html", true)
b.AssertLogContains("! Duplicate") // fails
}
The above emits this unexpected warning:
WARN Duplicate content path: "/p1" file: "/content/es/p1.md" file: "/content/en/p1.md"
Reference: https://discourse.gohugo.io/t/55931