]> Sergey Matveev's repositories - sgblog.git/commitdiff
ISO compatible, Atom-required, dates in comments feed v0.18.0
authorSergey Matveev <stargrave@stargrave.org>
Tue, 6 Jul 2021 11:23:37 +0000 (14:23 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 6 Jul 2021 11:23:37 +0000 (14:23 +0300)
cmd/sgblog/http.go
common.go

index 7ed1ea6e33219ded65715e5f8524d166a8f6d3c8..02237353366459d2fc20550fa27c22721c54814b 100644 (file)
@@ -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"),
index d6357fc984e9ba37c1850c05e2f9403135618b7c..587d2ce23a6912bc928b1a7d82fcbb048cdf7736 100644 (file)
--- 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"
 )