Added Tags to RSS feed as categories
This commit is contained in:
@ -58,6 +58,9 @@ func FinishArticle(al *data.ArticleList, s *data.CookieStore) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
r.ParseForm()
|
||||
article.Tags = append(article.Tags, r.Form["tags"]...)
|
||||
|
||||
session, err := s.Get(r, "cookie")
|
||||
if err != nil {
|
||||
tmpl, err := template.ParseFiles("web/templates/login.html")
|
||||
@ -71,7 +74,7 @@ func FinishArticle(al *data.ArticleList, s *data.CookieStore) http.HandlerFunc {
|
||||
article.AuthorID = session.Values["id"].(int64)
|
||||
|
||||
al.Add(article)
|
||||
al.Save("tmp/articles.gob")
|
||||
al.Save("tmp/unpublished-articles.gob")
|
||||
|
||||
tmpl, err := template.ParseFiles("web/templates/hub.html")
|
||||
tmpl = template.Must(tmpl, err)
|
||||
@ -147,6 +150,7 @@ func PublishArticle(c *data.Channel, al *data.ArticleList, s *data.CookieStore)
|
||||
PubDate: article.Created.Format(time.RFC1123Z),
|
||||
Description: article.Desc,
|
||||
Content: &rss.Content{Value: article.Content},
|
||||
Categories: article.Tags,
|
||||
})
|
||||
c.Save("tmp/rss.gob")
|
||||
|
||||
|
Reference in New Issue
Block a user