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:
Bjørn Erik Pedersen 2017-11-02 08:25:20 +01:00
parent 6233ddf9d1
commit 2e0465764b
14 changed files with 350 additions and 80 deletions

View file

@ -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)
}