mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-28 14:40:43 +03:00
Add multilingual multihost support
This commit adds multihost support when more than one language is configured and `baseURL` is set per language. Updates #4027
This commit is contained in:
parent
6233ddf9d1
commit
2e0465764b
14 changed files with 350 additions and 80 deletions
|
@ -257,6 +257,10 @@ func (p *Page) createRelativePermalinkForOutputFormat(f output.Format) string {
|
|||
tp = strings.TrimSuffix(tp, f.BaseFilename())
|
||||
}
|
||||
|
||||
if p.s.owner.IsMultihost() {
|
||||
tp = strings.TrimPrefix(tp, helpers.FilePathSeparator+p.s.Info.Language.Lang)
|
||||
}
|
||||
|
||||
return p.s.PathSpec.URLizeFilename(tp)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue