summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_multihost_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-11-20 10:34:30 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-11-20 11:17:46 +0100
commit089fe49309cd9cadba3ae9a5eddfd69622941a70 (patch)
tree4a27f20df4e50e5856af23e7e2e0cd293272e982 /hugolib/hugo_sites_multihost_test.go
parent118b83d74b5caaae6646ec031d59b8ab3491c6b2 (diff)
hugolib: Make sure everything ends up in its lang root in multihost mode
Fixes #4105
Diffstat (limited to 'hugolib/hugo_sites_multihost_test.go')
-rw-r--r--hugolib/hugo_sites_multihost_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_multihost_test.go b/hugolib/hugo_sites_multihost_test.go
index 88b306349..af96c766d 100644
--- a/hugolib/hugo_sites_multihost_test.go
+++ b/hugolib/hugo_sites_multihost_test.go
@@ -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())