Fix lack of title on syntax page

This commit is contained in:
Eliot Whalan 2016-06-26 06:45:54 +10:00
parent f7ce7d7abf
commit 70701454a0
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
1 changed files with 10 additions and 9 deletions

View File

@ -294,7 +294,6 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
link := ADDRESS + "/raw/" + paste link := ADDRESS + "/raw/" + paste
download := ADDRESS + "/download/" + paste download := ADDRESS + "/download/" + paste
clone := ADDRESS + "/clone/" + paste clone := ADDRESS + "/clone/" + paste
if lang == "" {
p := &Page{ p := &Page{
Title: title, Title: title,
Body: []byte(s), Body: []byte(s),
@ -303,13 +302,15 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
Download: download, Download: download,
Clone: clone, Clone: clone,
} }
if lang == "" {
err := templates.ExecuteTemplate(w, "paste.html", p) err := templates.ExecuteTemplate(w, "paste.html", p)
if err != nil { if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError) http.Error(w, err.Error(), http.StatusInternalServerError)
} }
} else { } else {
fmt.Fprintf(w, string(syntax), paste, paste, s, ADDRESS, download, link, clone) fmt.Fprintf(w, string(syntax), p.Title, p.Title, s, p.Home, p.Download, p.Raw, p.Clone)
} }
} }