Added description and a way to save and restore the RSS feed.

This commit is contained in:
2024-02-18 14:01:06 +01:00
parent ee04a2a351
commit c5623fe4fd
4 changed files with 46 additions and 10 deletions

View File

@ -8,9 +8,10 @@ import (
"streifling.com/jason/cpolis/cmd/feed"
)
func HandleFinishedEdit(f feed.Feed) http.HandlerFunc {
func HandleFinishedEdit(f *feed.Feed) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
title := r.PostFormValue("editor-title")
desc := r.PostFormValue("editor-desc")
mdContent := r.PostFormValue("editor-text")
content, err := articles.ConvertToHTML(mdContent)
@ -19,7 +20,8 @@ func HandleFinishedEdit(f feed.Feed) http.HandlerFunc {
log.Panicln(err)
}
feed.AddToFeed(f, title, content)
feed.AddToFeed(f, title, desc, content)
feed.SaveFeed(f, "tmp/rss.gob")
// template.Must(template.ParseFiles("web/templates/editor.html")).ExecuteTemplate(w, "html-result", rssItem)
}
}