-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Description
Similar to #12079, but there's no ambiguity in this case: we should not discard the page resource.
Below, en is the default content language.
content/
└── s1/
├── p1/
│ ├── a.txt
│ └── index.de.md <-- non-default content language, no matching bundle in english
├── _index.de.md
└── _index.en.md
Expected (v0.122.0)
public/
├── de/
│ ├── s1/
│ │ ├── p1/
│ │ │ ├── a.txt <-- this is missing in v0.123.1 see below
│ │ │ └── index.html
│ │ └── index.html
│ └── index.html
├── en/
│ ├── s1/
│ │ └── index.html
│ └── index.html
└── index.html
Actual (v0.123.1)
public/
├── de/
│ ├── s1/
│ │ ├── p1/
│ │ │ └── index.html
│ │ └── index.html
│ └── index.html
├── en/
│ ├── s1/
│ │ └── index.html
│ └── index.html
└── index.html
failing test case
func TestFoo(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
disableKinds = ['rss','sitemap','taxonomy','term']
defaultContentLanguage = 'en'
defaultContentLanguageInSubdir = true
[languages.en]
[languages.de]
-- layouts/_default/single.html --
{{ .RelPermalink }}
-- layouts/_default/list.html --
{{ .RelPermalink }}
-- content/s1/_index.de.md --
---
title: s1 (de)
---
-- content/s1/_index.en.md --
---
title: s1 (en)
---
-- content/s1/p1/index.de.md --
---
title: s1/p1 (de)
---
-- content/s1/p1/a.txt --
irrelevant
`
b := hugolib.Test(t, files)
b.AssertFileExists("public/de/s1/index.html", true)
b.AssertFileExists("public/de/s1/p1/index.html", true)
b.AssertFileExists("public/de/s1/p1/a.txt", true) // failing test
b.AssertFileExists("public/en/s1/index.html", true)
b.AssertFileExists("public/en/s1/p1/index.html", false)
b.AssertFileExists("public/en/s1/p1/a.txt", false)
}References:
nibe