Skip to content

Commit 86b2a27

Browse files
committedMay 17, 2023
Re-add site.LanguagePrefix
Updates #10947
1 parent 35955f5 commit 86b2a27

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎resources/page/site.go

+11
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ type Site interface {
133133

134134
// IsMultilingual reports whether this site is configured with more than one language.
135135
IsMultiLingual() bool
136+
137+
// LanguagePrefi returns the language prefix for this site.
138+
LanguagePrefix() string
136139
}
137140

138141
// Sites represents an ordered list of sites (languages).
@@ -292,6 +295,10 @@ func (s *siteWrapper) DisqusShortname() string {
292295
return s.s.DisqusShortname()
293296
}
294297

298+
func (s *siteWrapper) LanguagePrefix() string {
299+
return s.s.LanguagePrefix()
300+
}
301+
295302
type testSite struct {
296303
h hugo.HugoInfo
297304
l *langs.Language
@@ -348,6 +355,10 @@ func (t testSite) Current() Site {
348355
return t
349356
}
350357

358+
func (s testSite) LanguagePrefix() string {
359+
return ""
360+
}
361+
351362
func (t testSite) Languages() langs.Languages {
352363
return nil
353364
}

0 commit comments

Comments
 (0)
Please sign in to comment.