From e682fcc62233b47cf5bdcaf598ac0657ef089471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 17 May 2017 19:57:44 +0300 Subject: [PATCH] hugolib: Fix RSSLink vs RSS Output Format Fixes #3450 --- hugolib/site.go | 6 +++++- hugolib/site_output_test.go | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hugolib/site.go b/hugolib/site.go index bd029d47a..45acd54cf 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -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 { diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go index d57173630..824156e0b 100644 --- a/hugolib/site_output_test.go +++ b/hugolib/site_output_test.go @@ -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) + }