]> Sergey Matveev's repositories - sgblog.git/commitdiff
Include subject in comment URI v0.10.0
authorSergey Matveev <stargrave@stargrave.org>
Wed, 28 Oct 2020 10:11:34 +0000 (13:11 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 28 Oct 2020 10:12:51 +0000 (13:12 +0300)
README.texi
cmd/sgblog/http.go
common.go

index 9ede00801ae5d2377c181dd5e66dfb2a3700b58a..51c4accbca5529f073847747b6ebc524c05396eb 100644 (file)
@@ -69,7 +69,7 @@ Comments are posted through the email interface, just by sending the
 message to special address. For example:
 
 @example
-$ mutt "mailto:comment@@blog.example.com?subject=576540a5b98517b46d0efc791bb90b9121bf147e" <<EOF
+$ mutt "mailto:comment@@blog.example.com?subject=BlaBlaBla%20(576540a5b98517b46d0efc791bb90b9121bf147e)" <<EOF
 This is the comments contents.
 Could be multilined of course.
 EOF
index 854ebe6e7895ed9ffce26a1f0b7c084fa1a40fe3..4712a50f13584b98a81542a1d71cdd69c44307df 100644 (file)
@@ -142,7 +142,7 @@ Topics: {{range .Topics}}[<tt><a href="{{$Cfg.URLPrefix}}?topic={{.}}">{{.}}</a>
 {{end}}</pre>
 <hr/>{{end}}
 
-{{if .Cfg.CommentsEmail}}[<a href="mailto:{{.Cfg.CommentsEmail}}?subject={{.Commit.Hash.String}}">leave comment</a>]{{end}}
+{{if .Cfg.CommentsEmail}}[<a href="mailto:{{.Cfg.CommentsEmail}}?subject=Re:%20{{.TitleEscaped}}%20({{.Commit.Hash.String}})">leave comment</a>]{{end}}
 
 <dl>{{range $idx, $comment := .Comments}}
 <dt><a name="comment{{$idx}}"><a href="#comment{{$idx}}">comment {{$idx}}</a>:</dt>
@@ -785,6 +785,7 @@ func serveHTTP() {
                        Version         string
                        Cfg             *Cfg
                        Title           string
+                       TitleEscaped    string
                        When            string
                        AtomCommentsURL string
                        Parent          string
@@ -797,6 +798,7 @@ func serveHTTP() {
                        Version:         sgblog.Version,
                        Cfg:             cfg,
                        Title:           title,
+                       TitleEscaped:    strings.ReplaceAll(title, " ", "%20"),
                        When:            when,
                        AtomCommentsURL: atomCommentsURL,
                        Parent:          parent,
index 55d2d5f3eb1632e8a3133880e897e073dbb603cc..821d5b39deba806acabfaa2f4ee4b09a195fdc6a 100644 (file)
--- a/common.go
+++ b/common.go
@@ -2,6 +2,6 @@
 package sgblog
 
 const (
-       Version = "0.9.1"
+       Version = "0.10.0"
        WhenFmt = "2006-01-02 15:04:05Z07:00"
 )