diff --git a/assets/paste.html b/assets/paste.html index 19fc1d2..c8fb3c4 100644 --- a/assets/paste.html +++ b/assets/paste.html @@ -37,6 +37,7 @@
Home + Download Raw
diff --git a/assets/syntax.html b/assets/syntax.html index 2791a1f..59005c2 100644 --- a/assets/syntax.html +++ b/assets/syntax.html @@ -37,6 +37,7 @@
diff --git a/main.go b/main.go index c4e86bd..2ed7d5c 100644 --- a/main.go +++ b/main.go @@ -39,10 +39,11 @@ type Response struct { } type Page struct { - Title string - Body []byte - Raw string - Home string + Title string + Body []byte + Raw string + Home string + Download string } func check(err error) { @@ -235,12 +236,14 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) { lang := vars["lang"] s := getPaste(paste, lang) link := ADDRESS + "/raw/" + paste + download := ADDRESS + "/download/" + paste if lang == "" { p := &Page{ - Title: paste, - Body: []byte(s), - Raw: link, - Home: ADDRESS, + Title: paste, + Body: []byte(s), + Raw: link, + Home: ADDRESS, + Download: download, } err := templates.ExecuteTemplate(w, "paste.html", p) if err != nil { @@ -248,7 +251,7 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) { } } else { - fmt.Fprintf(w, string(syntax), paste, paste, s, ADDRESS, link) + fmt.Fprintf(w, string(syntax), paste, paste, s, ADDRESS, download, link) } }