hugolib: Fix RSSLink vs RSS Output Format
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 17 May 2017 16:57:44 +0000 (19:57 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 17 May 2017 19:14:31 +0000 (22:14 +0300)
Fixes #3450

hugolib/site.go
hugolib/site_output_test.go

index bd029d47af246e6987317ed39861c5a43ec64fd7..45acd54cf7203b5891e9af836308c15207092de3 100644 (file)
@@ -1139,7 +1139,11 @@ func (s *Site) initializeSiteInfo() {
                s:                              s,
        }
 
-       s.Info.RSSLink = s.permalink(lang.GetString("rssURI"))
+       rssOutputFormat, found := s.outputFormats[KindHome].GetByName(output.RSSFormat.Name)
+
+       if found {
+               s.Info.RSSLink = s.permalink(rssOutputFormat.BaseFilename())
+       }
 }
 
 func (s *Site) dataDir() string {
index d57173630e57b89dd2f8f049b3106b626421ac80..824156e0b8e8a990471b97e3d61be1c1c99dff24 100644 (file)
@@ -284,4 +284,9 @@ baseName = "feed"
 
        th.assertFileContent("public/feed.xml", "Recent content on")
 
+       s := h.Sites[0]
+
+       //Issue #3450
+       require.Equal(t, "http://example.com/blog/feed.xml", s.Info.RSSLink)
+
 }