Fix disabled languages regression

Fixes #11959
This commit is contained in:
Bjørn Erik Pedersen
2024-02-01 09:37:05 +01:00
parent 5dd06b4136
commit 4174a7866b
7 changed files with 113 additions and 19 deletions

View File

@@ -188,30 +188,43 @@ baseURL = "https://example.com"
disableKinds = ["taxonomy", "term"]
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
disableLanguages = ["nn"]
[languages]
[languages.en]
weight = 1
[languages.nn]
weight = 2
-- content/p1.md --
disabled = true
-- content/mysect/_index.md --
---
title: "My Sect En"
---
-- content/mysect/p1/index.md --
---
title: "P1"
---
P1
-- content/p1.nn.md --
-- content/mysect/_index.nn.md --
---
title: "My Sect Nn"
---
-- content/mysect/p1/index.nn.md --
---
title: "P1nn"
---
P1nn
-- layouts/index.html --
Len RegularPages: {{ len .Site.RegularPages }}|RegularPages: {{ range site.RegularPages }}{{ .RelPermalink }}: {{ .Title }}|{{ end }}|
Len Pages: {{ len .Site.Pages }}|
Len Sites: {{ len .Site.Sites }}|
-- layouts/_default/single.html --
{{ .Title }}|{{ .Content }}|{{ .Lang }}|
`
b := Test(t, files)
b.AssertFileContent("public/en/p1/index.html", "P1|<p>P1</p>\n|en|")
b.AssertFileExists("public/public/nn/p1/index.html", false)
b.AssertFileContent("public/en/index.html", "Len RegularPages: 1|")
b.AssertFileContent("public/en/mysect/p1/index.html", "P1|<p>P1</p>\n|en|")
b.AssertFileExists("public/public/nn/mysect/p1/index.html", false)
b.Assert(len(b.H.Sites), qt.Equals, 1)
}