Skip to content

Commit

Permalink
Re-add site.LanguagePrefix
Browse files Browse the repository at this point in the history
Updates #10947
  • Loading branch information
bep committed May 17, 2023
1 parent 35955f5 commit 86b2a27
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/page/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 86b2a27

Please sign in to comment.