From 898cbafe87a2ab4ff347ebaf9e4b7d04506ad764 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 18 Feb 2016 00:52:10 +0100 Subject: Switch to Markdown --- view.go | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 view.go (limited to 'view.go') diff --git a/view.go b/view.go deleted file mode 100644 index 3a1c47a..0000000 --- a/view.go +++ /dev/null @@ -1,22 +0,0 @@ -package main - -import ( - "net/http" - "text/template" -) - -func init() { - http.HandleFunc("/view/", viewHandler) -} - -var viewtmpl = template.Must(template.ParseFiles("tmpl/root", "tmpl/view")) - -func viewHandler(w http.ResponseWriter, r *http.Request) { - title := r.URL.Path[len("/view/"):] - p, err := loadPage(title) - if err != nil { - http.Redirect(w, r, "/edit/"+title, http.StatusFound) - return - } - p.render(w, viewtmpl) -} -- cgit v1.2.3