aboutsummaryrefslogtreecommitdiff
path: root/edit.go
diff options
context:
space:
mode:
Diffstat (limited to 'edit.go')
-rw-r--r--edit.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/edit.go b/edit.go
index a425a1a..3a4ca37 100644
--- a/edit.go
+++ b/edit.go
@@ -9,8 +9,10 @@ func init() {
http.HandleFunc("/edit/", editHandler)
}
+var edittmpl = template.Must(template.ParseFiles("tmpl/root", "tmpl/edit"))
+
func editHandler(w http.ResponseWriter, r *http.Request) {
title := r.URL.Path[len("/edit/"):]
p, _ := loadPage(title)
- p.render(w, template.Must(template.ParseFiles("tmpl/root", "tmpl/edit")))
+ p.render(w, edittmpl)
}