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"`
|
Title string `xml:"title"`
|
||||||
Link string `xml:"link"`
|
Link string `xml:"link"`
|
||||||
PubDate string `xml:"pubDate"`
|
PubDate string `xml:"pubDate"`
|
||||||
|
Description string `xml:"description"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func RenderRSSFeed(user User) (string, error) {
|
func RenderRSSFeed(user User) (string, error) {
|
||||||
|
@ -43,11 +44,13 @@ func RenderRSSFeed(user User) (string, error) {
|
||||||
posts, _ := user.Posts()
|
posts, _ := user.Posts()
|
||||||
for _, post := range posts {
|
for _, post := range posts {
|
||||||
meta := post.Meta()
|
meta := post.Meta()
|
||||||
|
content, _ := renderPostContent(post)
|
||||||
rss.Channel.Items = append(rss.Channel.Items, RSSItem{
|
rss.Channel.Items = append(rss.Channel.Items, RSSItem{
|
||||||
Guid: post.FullUrl(),
|
Guid: post.FullUrl(),
|
||||||
Title: post.Title(),
|
Title: post.Title(),
|
||||||
Link: post.FullUrl(),
|
Link: post.FullUrl(),
|
||||||
PubDate: meta.Date.Format(time.RFC1123Z),
|
PubDate: meta.Date.Format(time.RFC1123Z),
|
||||||
|
Description: content,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue