Re-add site.RSSLink (and deprecate it)

Fixes #11110
This commit is contained in:
Bjørn Erik Pedersen
2023-06-14 12:04:32 +02:00
parent bb9377b5e5
commit 90b2674ddc
3 changed files with 18 additions and 7 deletions

View File

@@ -137,6 +137,9 @@ type Site interface {
// LanguagePrefix returns the language prefix for this site.
LanguagePrefix() string
// Deprecated. Use site.Home.OutputFormats.Get "rss" instead.
RSSLink() template.URL
}
// Sites represents an ordered list of sites (languages).
@@ -300,6 +303,10 @@ func (s *siteWrapper) LanguagePrefix() string {
return s.s.LanguagePrefix()
}
func (s *siteWrapper) RSSLink() template.URL {
return s.s.RSSLink()
}
type testSite struct {
h hugo.HugoInfo
l *langs.Language
@@ -444,6 +451,10 @@ func (s testSite) Param(key any) (any, error) {
return nil, nil
}
func (s testSite) RSSLink() template.URL {
return ""
}
// NewDummyHugoSite creates a new minimal test site.
func NewDummyHugoSite(conf config.AllProvider) Site {
return testSite{