From: Artem Vorotnikov Date: Sun, 24 May 2015 13:48:46 +0000 (+0300) Subject: Allow custom RSS Uri for section and taxonomy feeds X-Git-Tag: v0.15~365 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3cee9b77;p=brevno-suite%2Fhugo Allow custom RSS Uri for section and taxonomy feeds Fixes #1147 --- diff --git a/hugolib/site.go b/hugolib/site.go index 1fe4cb4e..a11b52de 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1123,11 +1123,11 @@ func taxonomyRenderer(s *Site, taxes <-chan taxRenderInfo, results chan<- error, if !viper.GetBool("DisableRSS") { // XML Feed - n.URL = s.permalinkStr(base + "/index.xml") + n.URL = s.permalinkStr(base + "/" + viper.GetString("RSSUri")) n.Permalink = s.permalink(base) rssLayouts := []string{"taxonomy/" + t.singular + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"} - if err := s.renderAndWriteXML("taxonomy "+t.singular+" rss", base+"/index.xml", n, s.appendThemeTemplates(rssLayouts)...); err != nil { + if err := s.renderAndWriteXML("taxonomy "+t.singular+" rss", base+"/"+viper.GetString("RSSUri"), n, s.appendThemeTemplates(rssLayouts)...); err != nil { results <- err continue } @@ -1225,10 +1225,10 @@ func (s *Site) RenderSectionLists() error { if !viper.GetBool("DisableRSS") && section != "" { // XML Feed - n.URL = s.permalinkStr(section + "/index.xml") + n.URL = s.permalinkStr(section + "/" + viper.GetString("RSSUri")) n.Permalink = s.permalink(section) rssLayouts := []string{"section/" + section + ".rss.xml", "_default/rss.xml", "rss.xml", "_internal/_default/rss.xml"} - if err := s.renderAndWriteXML("section "+section+" rss", section+"/index.xml", n, s.appendThemeTemplates(rssLayouts)...); err != nil { + if err := s.renderAndWriteXML("section "+section+" rss", section+"/"+viper.GetString("RSSUri"), n, s.appendThemeTemplates(rssLayouts)...); err != nil { return err } }