URI: 
       Re-add site.RSSLink (and deprecate it) - hugo - [fork] hugo port for 9front
  HTML git clone git@git.drkhsh.at/hugo.git
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
   DIR README
   DIR LICENSE
       ---
   DIR commit 90b2674ddce69a07007b1ba60eb4808bbb38e8a4
   DIR parent bb9377b5e552448ca392a7c5b2e20bdb5ee07aa1
  HTML Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
       Date:   Wed, 14 Jun 2023 12:04:32 +0200
       
       Re-add site.RSSLink (and deprecate it)
       
       Fixes #11110
       
       Diffstat:
         M hugolib/site_new.go                 |      11 +++++------
         M hugolib/site_output_test.go         |       3 ++-
         M resources/page/site.go              |      11 +++++++++++
       
       3 files changed, 18 insertions(+), 7 deletions(-)
       ---
   DIR diff --git a/hugolib/site_new.go b/hugolib/site_new.go
       @@ -29,6 +29,7 @@ import (
                "github.com/gohugoio/hugo/config"
                "github.com/gohugoio/hugo/config/allconfig"
                "github.com/gohugoio/hugo/deps"
       +        "github.com/gohugoio/hugo/helpers"
                "github.com/gohugoio/hugo/identity"
                "github.com/gohugoio/hugo/langs"
                "github.com/gohugoio/hugo/langs/i18n"
       @@ -345,12 +346,10 @@ func (s *Site) Copyright() string {
                return s.conf.Copyright
        }
        
       -func (s *Site) RSSLink() string {
       -        rssOutputFormat, found := s.conf.C.KindOutputFormats[page.KindHome].GetByName("rss")
       -        if !found {
       -                return ""
       -        }
       -        return s.permalink(rssOutputFormat.BaseFilename())
       +func (s *Site) RSSLink() template.URL {
       +        helpers.Deprecated("Site.RSSLink", "Use the Output Format's Permalink method instead, e.g. .OutputFormats.Get \"RSS\".Permalink", false)
       +        rssOutputFormat := s.home.OutputFormats().Get("rss")
       +        return template.URL(rssOutputFormat.Permalink())
        }
        
        func (s *Site) Config() page.SiteConfig {
   DIR diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go
       @@ -15,6 +15,7 @@ package hugolib
        
        import (
                "fmt"
       +        "html/template"
                "strings"
                "testing"
        
       @@ -248,7 +249,7 @@ baseName = "feed"
                s := h.Sites[0]
        
                // Issue #3450
       -        c.Assert(s.RSSLink(), qt.Equals, "http://example.com/blog/feed.xml")
       +        c.Assert(s.RSSLink(), qt.Equals, template.URL("http://example.com/blog/feed.xml"))
        }
        
        // Issue #3614
   DIR diff --git a/resources/page/site.go b/resources/page/site.go
       @@ -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{