mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +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
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue