Skip to content

Commit e682fcc

Browse files
committed
hugolib: Fix RSSLink vs RSS Output Format
Fixes #3450
1 parent b6ea492 commit e682fcc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎hugolib/site.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,11 @@ func (s *Site) initializeSiteInfo() {
11391139
s: s,
11401140
}
11411141

1142-
s.Info.RSSLink = s.permalink(lang.GetString("rssURI"))
1142+
rssOutputFormat, found := s.outputFormats[KindHome].GetByName(output.RSSFormat.Name)
1143+
1144+
if found {
1145+
s.Info.RSSLink = s.permalink(rssOutputFormat.BaseFilename())
1146+
}
11431147
}
11441148

11451149
func (s *Site) dataDir() string {

‎hugolib/site_output_test.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,9 @@ baseName = "feed"
284284

285285
th.assertFileContent("public/feed.xml", "Recent content on")
286286

287+
s := h.Sites[0]
288+
289+
//Issue #3450
290+
require.Equal(t, "http://example.com/blog/feed.xml", s.Info.RSSLink)
291+
287292
}

0 commit comments

Comments
 (0)