This commit is contained in:
glidea
2025-06-05 23:46:54 +08:00
parent d520444e9f
commit ef2c44438c
7 changed files with 18 additions and 12 deletions

View File

@@ -16,7 +16,6 @@
package rss
import (
"fmt"
"net"
"net/http"
"text/template"
@@ -185,12 +184,13 @@ func (s *server) rss(w http.ResponseWriter, r *http.Request) {
})
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest) // TODO: standardize error handling.
return
}
// Render and convert to RSS.
rssObj := &feeds.Feed{
Title: fmt.Sprintf("Zenfeed RSS - %s", ps.Encode()),
Title: "Zenfeed RSS - " + ps.Encode(),
Description: "Powered by Github Zenfeed - https://github.com/glidea/zenfeed. If you use Folo, please enable 'Appearance - Content - Render inline styles'",
Items: make([]*feeds.Item, 0, len(queryResult.Feeds)),
}
@@ -203,6 +203,7 @@ func (s *server) rss(w http.ResponseWriter, r *http.Request) {
if err = s.Config().contentHTMLTemplate.Execute(buf, feed.Labels.Map()); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
@@ -218,6 +219,7 @@ func (s *server) rss(w http.ResponseWriter, r *http.Request) {
if err = rssObj.WriteRss(w); err != nil {
log.Error(ctx, errors.Wrap(err, "write rss response"))
return
}
}