summaryrefslogtreecommitdiffstats
path: root/hugolib/site.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-07-07 18:41:10 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-07-08 16:08:46 +0200
commit92e86702eab5d68cd4eda87069fba906139f5c08 (patch)
tree6edb31f509cb321b3ab9d038bfd6d50ea07f6fac /hugolib/site.go
parent6c9ea022a9022a281031eed75ceb00c4c03f2b5a (diff)
Fix defaultContentLanguageInSubdir with only 1 language
Fixes #10064
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go11
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 {