mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
hugolib: Make sure everything ends up in its lang root in multihost mode
Fixes #4105
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user