shithub: hugo

Download patch

ref: e682fcc62233b47cf5bdcaf598ac0657ef089471
parent: b6ea492b7a6325d04d44eeb00a990a3a0e29e0c0
author: Bjørn Erik Pedersen <[email protected]>
date: Wed May 17 15:57:44 EDT 2017

hugolib: Fix RSSLink vs RSS Output Format

Fixes #3450

--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1139,7 +1139,11 @@
 		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 {
--- a/hugolib/site_output_test.go
+++ b/hugolib/site_output_test.go
@@ -284,4 +284,9 @@
 
 	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)
+
 }