Re-add site.LanguagePrefix

Updates #10947
This commit is contained in:
Bjørn Erik Pedersen 2023-05-17 23:27:40 +02:00
parent 35955f50e6
commit 86b2a27438
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -133,6 +133,9 @@ type Site interface {
// IsMultilingual reports whether this site is configured with more than one language.
IsMultiLingual() bool
// LanguagePrefi returns the language prefix for this site.
LanguagePrefix() string
}
// Sites represents an ordered list of sites (languages).
@ -292,6 +295,10 @@ func (s *siteWrapper) DisqusShortname() string {
return s.s.DisqusShortname()
}
func (s *siteWrapper) LanguagePrefix() string {
return s.s.LanguagePrefix()
}
type testSite struct {
h hugo.HugoInfo
l *langs.Language
@ -348,6 +355,10 @@ func (t testSite) Current() Site {
return t
}
func (s testSite) LanguagePrefix() string {
return ""
}
func (t testSite) Languages() langs.Languages {
return nil
}