Allow custom RSS Uri for section and taxonomy feeds
authorArtem Vorotnikov <artem@vorotnikov.me>
Sun, 24 May 2015 13:48:46 +0000 (16:48 +0300)
committerbep <bjorn.erik.pedersen@gmail.com>
Sun, 31 May 2015 13:59:51 +0000 (15:59 +0200)
Fixes #1147

hugolib/site.go

index 1fe4cb4e37c2f715879ecdce635574026c5c3c18..a11b52de46c8f32421178723842b9f419ba78907 100644 (file)
@@ -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
                        }
                }