mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Improve behavior of defaultContentLanguageInSubdir when only the default language is enabled
1 .Create sitemapindex in root of publishDir (will contain link to sitemap.xml in defaultContentLanguage site) 2. Create index.html in root of publishDir (will redirect to defaultContentLanguage site) Fixes #11229
This commit is contained in:
@@ -1321,6 +1321,9 @@ Home.
|
||||
|
||||
b.AssertFileContent("public/en/index.html", "Home.")
|
||||
b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
|
||||
b.AssertFileContent("public/index.html", "refresh")
|
||||
b.AssertFileContent("public/sitemap.xml", "sitemapindex")
|
||||
b.AssertFileContent("public/en/sitemap.xml", "urlset")
|
||||
})
|
||||
|
||||
t.Run("Two languages, default in sub dir", func(t *testing.T) {
|
||||
@@ -1351,6 +1354,9 @@ Home.
|
||||
|
||||
b.AssertFileContent("public/en/index.html", "Home.")
|
||||
b.AssertFileContent("public/en/foo/bar.txt", "Foo.")
|
||||
b.AssertFileContent("public/index.html", "refresh")
|
||||
b.AssertFileContent("public/sitemap.xml", "sitemapindex")
|
||||
b.AssertFileContent("public/en/sitemap.xml", "urlset")
|
||||
})
|
||||
|
||||
t.Run("Two languages, default in root", func(t *testing.T) {
|
||||
@@ -1381,6 +1387,8 @@ Home.
|
||||
|
||||
b.AssertFileContent("public/index.html", "Home.")
|
||||
b.AssertFileContent("public/foo/bar.txt", "Foo.")
|
||||
b.AssertFileContent("public/sitemap.xml", "sitemapindex")
|
||||
b.AssertFileContent("public/en/sitemap.xml", "urlset")
|
||||
})
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user