X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=cmd%2Fsgblog%2Fgopher.go;h=183914c8c582399b621c2506e5c01c42eb836b2c;hb=cc110e327d5df988f9a5d94c02af5673e05f9b73;hp=ce820d153cc856ed938ec711b8b07cbc1039037f;hpb=0d72293f0d5c72ef66391b5b81be72f51fda30a1;p=sgblog.git
diff --git a/cmd/sgblog/gopher.go b/cmd/sgblog/gopher.go
index ce820d1..183914c 100644
--- a/cmd/sgblog/gopher.go
+++ b/cmd/sgblog/gopher.go
@@ -25,6 +25,7 @@ import (
"io"
"io/ioutil"
"log"
+ "net/url"
"os"
"strconv"
"strings"
@@ -66,7 +67,7 @@ Note:
{{.Note}}{{end -}}
{{- if .Cfg.CommentsEmail}}
------------------------------------------------------------------------
-leave comment: mailto:{{.Cfg.CommentsEmail}}?subject={{.Commit.Hash.String}}
+leave comment: mailto:{{.Cfg.CommentsEmail}}?subject={{.TitleEscaped}}
{{end}}{{range $idx, $comment := .Comments}}
------------------------------------------------------------------------
comment {{$idx}}:
@@ -140,13 +141,14 @@ Redirecting to %s...
}
tmpl := template.Must(template.New("entry").Parse(TmplGopherEntry))
err = tmpl.Execute(os.Stdout, struct {
- Commit *object.Commit
- When string
- Cfg *Cfg
- Note string
- Comments []string
- Topics []string
- Version string
+ Commit *object.Commit
+ When string
+ Cfg *Cfg
+ Note string
+ Comments []string
+ Topics []string
+ Version string
+ TitleEscaped string
}{
Commit: commit,
When: commit.Author.When.Format(sgblog.WhenFmt),
@@ -155,6 +157,9 @@ Redirecting to %s...
Comments: parseComments(getNote(commentsTree, commit.Hash)),
Topics: parseTopics(getNote(topicsTree, commit.Hash)),
Version: sgblog.Version,
+ TitleEscaped: url.PathEscape(fmt.Sprintf(
+ "Re: %s (%s)", msgSplit(commit.Message)[0], commit.Hash,
+ )),
})
if err != nil {
log.Fatalln(err)