From 3030b4a36057a6359057ce294be847a97a9f70f1 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Thu, 11 Dec 2025 03:03:07 -0500 Subject: Tweak to improve RSS compliance --- cmd/web/handlers/export.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/web/handlers/export.go b/cmd/web/handlers/export.go index becdae8..83309d8 100644 --- a/cmd/web/handlers/export.go +++ b/cmd/web/handlers/export.go @@ -18,6 +18,7 @@ type Item struct { XMLName xml.Name `xml:"item"` Title string `xml:"title"` Link string `xml:"link"` + Guid string `xml:"guid"` Description string `xml:"description"` PubDate string `xml:"pubDate"` Content string `xml:"content:encoded"` @@ -41,7 +42,7 @@ type rssExportContext struct { func (ctx *rssExportContext) feed(w http.ResponseWriter, r *http.Request) { feed := &Channel{ Title: "Paterissa", - Link: ctx.serv, + Link: "https://" + ctx.serv, Description: "Blog feed", } @@ -64,7 +65,7 @@ func (ctx *rssExportContext) feed(w http.ResponseWriter, r *http.Request) { return } - p.FormattedTime = p.Time.Format(time.ANSIC) + p.FormattedTime = p.Time.Format(time.RFC822) title := "" z := html.NewTokenizer(strings.NewReader(string(p.Brief))) @@ -90,7 +91,8 @@ func (ctx *rssExportContext) feed(w http.ResponseWriter, r *http.Request) { feed.Items = append(feed.Items, Item{ Title: title, - Link: ctx.serv + "/post?id=" + strconv.Itoa(p.Id), + Link: "https://" + ctx.serv + "/post?id=" + strconv.Itoa(p.Id), + Guid: "https://" + ctx.serv + "/post?id=" + strconv.Itoa(p.Id), Description: brief, PubDate: p.FormattedTime, Content: content, -- cgit v1.2.3