mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -389,13 +389,13 @@ func (s *Site) renderMainLanguageRedirect() error {
|
||||
mainLang := s.h.multilingual.DefaultLang
|
||||
if s.Info.defaultContentLanguageInSubdir {
|
||||
mainLangURL := s.PathSpec.AbsURL(mainLang.Lang+"/", false)
|
||||
s.Log.Debug().Printf("Write redirect to main language %s: %s", mainLang, mainLangURL)
|
||||
s.Log.Debugf("Write redirect to main language %s: %s", mainLang, mainLangURL)
|
||||
if err := s.publishDestAlias(true, "/", mainLangURL, html, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
mainLangURL := s.PathSpec.AbsURL("", false)
|
||||
s.Log.Debug().Printf("Write redirect to main language %s: %s", mainLang, mainLangURL)
|
||||
s.Log.Debugf("Write redirect to main language %s: %s", mainLang, mainLangURL)
|
||||
if err := s.publishDestAlias(true, mainLang.Lang, mainLangURL, html, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user