description in rss items
This commit is contained in:
parent
edf74aa330
commit
5fb96ee6fd
3
rss.go
3
rss.go
|
@ -24,6 +24,7 @@ type RSSItem struct {
|
|||
Title string `xml:"title"`
|
||||
Link string `xml:"link"`
|
||||
PubDate string `xml:"pubDate"`
|
||||
Description string `xml:"description"`
|
||||
}
|
||||
|
||||
func RenderRSSFeed(user User) (string, error) {
|
||||
|
@ -43,11 +44,13 @@ func RenderRSSFeed(user User) (string, error) {
|
|||
posts, _ := user.Posts()
|
||||
for _, post := range posts {
|
||||
meta := post.Meta()
|
||||
content, _ := renderPostContent(post)
|
||||
rss.Channel.Items = append(rss.Channel.Items, RSSItem{
|
||||
Guid: post.FullUrl(),
|
||||
Title: post.Title(),
|
||||
Link: post.FullUrl(),
|
||||
PubDate: meta.Date.Format(time.RFC1123Z),
|
||||
Description: content,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue