1
0

Gather mindflow posts in RSS.

This commit is contained in:
Alexander Andreev 2023-05-22 03:25:14 +04:00
parent 1b61434623
commit 7bab607e25
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -146,9 +146,15 @@ func (h *Handlers) GuestbookAdmin(w http.ResponseWriter, r *http.Request) {
}
func (h *Handlers) RSS(w http.ResponseWriter, r *http.Request) {
posts := []mindflow.Post{
{Category: mindflow.Category{ID: 1, Name: "Update"}, Date: time.Now(), Title: "LMAO", Body: "Testing!"},
posts, err := h.mindflowDB.GetAll()
if err != nil {
return
}
for _, entry := range posts {
entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n")
}
web.RSS(r.URL.Scheme+"://"+r.Host, "Arav", posts, r, w)
}