From ba7b08d6a06c11b2e5783cc67298a85b8dc1b51d Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 6 Jul 2021 14:23:37 +0300 Subject: [PATCH] ISO compatible, Atom-required, dates in comments feed --- cmd/sgblog/http.go | 12 ++++++++---- common.go | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/sgblog/http.go b/cmd/sgblog/http.go index 7ed1ea6..0223735 100644 --- a/cmd/sgblog/http.go +++ b/cmd/sgblog/http.go @@ -645,8 +645,8 @@ func serveHTTP() { commit.Hash.String(), "#comment", commentN, }, ""), }}, - Published: atom.TimeStr(date), - Updated: atom.TimeStr(date), + Published: atom.TimeStr(strings.Replace(date, " ", "T", -1)), + Updated: atom.TimeStr(strings.Replace(date, " ", "T", -1)), Content: &atom.Text{ Type: "html", Body: strings.Join(htmlized, "\n"), @@ -747,8 +747,12 @@ func serveHTTP() { "#comment", comment.n, }, ""), }}, - Published: atom.TimeStr(comment.date), - Updated: atom.TimeStr(comment.date), + Published: atom.TimeStr( + strings.Replace(comment.date, " ", "T", -1), + ), + Updated: atom.TimeStr( + strings.Replace(comment.date, " ", "T", -1), + ), Content: &atom.Text{ Type: "html", Body: strings.Join(htmlized, "\n"), diff --git a/common.go b/common.go index d6357fc..587d2ce 100644 --- a/common.go +++ b/common.go @@ -15,7 +15,7 @@ import ( ) const ( - Version = "0.17.0" + Version = "0.18.0" WhenFmt = "2006-01-02 15:04:05Z07:00" ) -- 2.44.0