aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Johnson <[email protected]>2025-12-11 03:03:07 -0500
committerSamuel Johnson <[email protected]>2025-12-11 03:03:07 -0500
commit3030b4a36057a6359057ce294be847a97a9f70f1 (patch)
tree00d15b4af182519292ea5f0e05f1055ad2813c8a
parentd4ad397b85994d4d6fdfbf75ce1bc65fdb2f9b33 (diff)
Tweak to improve RSS compliance
-rw-r--r--cmd/web/handlers/export.go8
1 files changed, 5 insertions, 3 deletions
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,