mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
hugolib: Make sure everything ends up in its lang root in multihost mode
Fixes #4105
This commit is contained in:
parent
118b83d74b
commit
089fe49309
5 changed files with 181 additions and 144 deletions
|
@ -68,6 +68,22 @@ languageName = "Nynorsk"
|
|||
assert.Len(s1h.Translations(), 2)
|
||||
assert.Equal("https://example.com/", s1h.Permalink())
|
||||
|
||||
// For “regular multilingual” we kept the aliases pages with url in front matter
|
||||
// as a literal value that we use as is.
|
||||
// There is an ambiguity in the guessing.
|
||||
// For multihost, we never want any content in the root.
|
||||
//
|
||||
// check url in front matter:
|
||||
pageWithURLInFrontMatter := s1.getPage(KindPage, "sect/doc3.en.md")
|
||||
assert.NotNil(pageWithURLInFrontMatter)
|
||||
assert.Equal("/superbob", pageWithURLInFrontMatter.URL())
|
||||
assert.Equal("/superbob/", pageWithURLInFrontMatter.RelPermalink())
|
||||
th.assertFileContent("public/en/superbob/index.html", "doc3|Hello|en")
|
||||
|
||||
// check alias:
|
||||
th.assertFileContent("public/en/al/alias1/index.html", `content="0; url=https://example.com/superbob/"`)
|
||||
th.assertFileContent("public/en/al/alias2/index.html", `content="0; url=https://example.com/superbob/"`)
|
||||
|
||||
s2 := sites.Sites[1]
|
||||
assert.Equal([]string{"s1", "s2", "frs1", "frs2"}, s2.StaticDirs())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue