From: Sergey Matveev Date: Tue, 6 Jul 2021 11:23:37 +0000 (+0300) Subject: ISO compatible, Atom-required, dates in comments feed X-Git-Tag: v0.18.0^0 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ba7b08d6a06c11b2e5783cc67298a85b8dc1b51d;p=sgblog.git ISO compatible, Atom-required, dates in comments feed --- 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" )