mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
@@ -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 {
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user