diff options
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index 7a3528929..eb6a4e344 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -887,21 +887,16 @@ func (s *Site) getLanguageTargetPathLang(alwaysInSubDir bool) string { // get any language code to prefix the relative permalink with. func (s *Site) getLanguagePermalinkLang(alwaysInSubDir bool) string { - if !s.h.isMultiLingual() || s.h.Conf.IsMultihost() { + if s.h.Conf.IsMultihost() { return "" } - if alwaysInSubDir { + if s.h.Conf.IsMultiLingual() && alwaysInSubDir { return s.Language().Lang } - isDefault := s.Language().Lang == s.conf.DefaultContentLanguage - - if !isDefault || s.conf.DefaultContentLanguageInSubdir { - return s.Language().Lang - } + return s.GetLanguagePrefix() - return "" } func (s *Site) getTaxonomyKey(key string) string { |