summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorcage <cage-dev@twistfold.it>2026-04-24 11:13:01 +0200
committernytpu <alex@nytpu.com>2026-04-26 08:57:22 -0600
commite68b88405f682efac033e447801a8f994b9ba6e0 (patch)
tree98e48366d3f0c3e11318c818ea442543268495ce /core
parent8737a9a254a10dcaed93be1219244b702d0d30b3 (diff)
add date for each feed entry's link, to match gemlog specs.
Hi! This is a little patch (and I guess not well written as I never coded in golang, before!) to make the output of comitium matches the gemlog specification. This way clients can subscribe to the feed (if clients supports the standard, of course!). Please consider merging if you find useful. Bye! C.
Diffstat (limited to 'core')
-rw-r--r--core/entries.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/entries.go b/core/entries.go
index c3c7034..273d2b3 100644
--- a/core/entries.go
+++ b/core/entries.go
@@ -142,15 +142,16 @@ func (d *FullData) WriteFeed(dataPath string) error {
for _, entry := range pe.Entries {
// get just the date it was published
pub := toLocalDay(entry.Published)
+ formattedPubDay := entry.Published.Format("2006-01-02")
if pub.Before(curDay) {
curDay = pub
- rawPage += fmt.Sprintf("\n\n## %s\n\n", curDay.Format("2006-01-02"))
+ rawPage += fmt.Sprintf("\n\n## %s\n\n", formattedPubDay)
}
if entry.Title == "" {
- rawPage += fmt.Sprintf("=> %s %s\n", entry.URL, entry.Prefix)
+ rawPage += fmt.Sprintf("=> %s %s %s\n", entry.URL, formattedPubDay, entry.Prefix)
} else {
- rawPage += fmt.Sprintf("=> %s %s — %s\n", entry.URL, entry.Prefix, entry.Title)
+ rawPage += fmt.Sprintf("=> %s %s %s — %s\n", entry.URL, formattedPubDay, entry.Prefix, entry.Title)
}
}
}