@ -5,16 +5,19 @@ import (
"github.com/gorilla/feeds"
"github.com/gorilla/feeds"
)
)
func GenerateRssFeed ( entries [ ] * articles . Article ) * feeds . Feed {
func GenerateRssFeed ( entries [ ] * articles . Article , title string , link string , description string ) * feeds . Feed {
// Initialize RSS Feed
// Initialize RSS Feed
feed := & feeds . Feed { }
feed := & feeds . Feed {
Title : title ,
Link : & feeds . Link { Href : link } ,
Description : description ,
}
var feedItems [ ] * feeds . Item
var feedItems [ ] * feeds . Item
// Add items to RSS feeds
// Add items to RSS feeds
for _ , entry := range entries {
for _ , entry := range entries {
feedItems = append ( feedItems ,
feedItems = append ( feedItems ,
& feeds . Item {
& feeds . Item {
Id : entry . Id ,
Id : entry . Id ,
@ -24,7 +27,6 @@ func GenerateRssFeed(entries []*articles.Article) *feeds.Feed {
Created : entry . PublishDate ,
Created : entry . PublishDate ,
} )
} )
}
}
feed . Items = feedItems
feed . Items = feedItems
return feed
return feed