summaryrefslogtreecommitdiffhomepage
path: root/helpers/language.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-01-06 18:42:32 +0100
committerBjørn Erik Pedersen <[email protected]>2018-01-06 19:14:31 +0100
commit8969331f5be352939883074034adac6b7086ddc8 (patch)
treed8782bd1e9d2741816399d446653c39d7cb97f61 /helpers/language.go
parent6feb138785eeb9e813428d0df30010d9b5fb1059 (diff)
downloadhugo-8969331f5be352939883074034adac6b7086ddc8.tar.gz
hugo-8969331f5be352939883074034adac6b7086ddc8.zip
Fix multihost detection for sites without language definition
Static content was wrongly put into the lang-code subfolder. Fixes #4221
Diffstat (limited to 'helpers/language.go')
-rw-r--r--helpers/language.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/helpers/language.go b/helpers/language.go
index 3cb388abb..fa933fddd 100644
--- a/helpers/language.go
+++ b/helpers/language.go
@@ -100,9 +100,13 @@ func (l *Language) Params() map[string]interface{} {
return l.params
}
-// IsMultihost returns whether the languages has baseURL specificed on the
-// language level.
+// IsMultihost returns whether there are more than one language and at least one of
+// the languages has baseURL specificed on the language level.
func (l Languages) IsMultihost() bool {
+ if len(l) <= 1 {
+ return false
+ }
+
for _, lang := range l {
if lang.GetLocal("baseURL") != nil {
return true