diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-05-17 19:57:44 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-05-17 22:14:31 +0300 |
commit | e682fcc62233b47cf5bdcaf598ac0657ef089471 (patch) | |
tree | 145c429571c4d0e3976b9b63ac1809349ce1df0c /hugolib | |
parent | b6ea492b7a6325d04d44eeb00a990a3a0e29e0c0 (diff) |
hugolib: Fix RSSLink vs RSS Output Format
Fixes #3450
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/site.go | 6 | ||||
-rw-r--r-- | hugolib/site_output_test.go | 5 |
2 files changed, 10 insertions, 1 deletions
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) + } |