aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_render.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2017-11-20 10:34:30 +0100
committerBjørn Erik Pedersen <[email protected]>2017-11-20 11:17:46 +0100
commit089fe49309cd9cadba3ae9a5eddfd69622941a70 (patch)
tree4a27f20df4e50e5856af23e7e2e0cd293272e982 /hugolib/site_render.go
parent118b83d74b5caaae6646ec031d59b8ab3491c6b2 (diff)
downloadhugo-089fe49309cd9cadba3ae9a5eddfd69622941a70.tar.gz
hugo-089fe49309cd9cadba3ae9a5eddfd69622941a70.zip
hugolib: Make sure everything ends up in its lang root in multihost mode
Fixes #4105
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r--hugolib/site_render.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
index 2a5fec7ba..c14592c89 100644
--- a/hugolib/site_render.go
+++ b/hugolib/site_render.go
@@ -16,6 +16,7 @@ package hugolib
import (
"fmt"
"path"
+ "strings"
"sync"
"github.com/gohugoio/hugo/helpers"
@@ -380,6 +381,13 @@ func (s *Site) renderAliases() error {
a = path.Join(a, f.Path)
}
+ lang := p.Lang()
+
+ if s.owner.multihost && !strings.HasPrefix(a, "/"+lang) {
+ // These need to be in its language root.
+ a = path.Join(lang, a)
+ }
+
if err := s.writeDestAlias(a, plink, p); err != nil {
return err
}