aboutsummaryrefslogtreecommitdiff
path: root/edit.go
blob: a425a1abd1f982d25387559fa91ccaaf2a741734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package main

import (
	"net/http"
	"text/template"
)

func init() {
	http.HandleFunc("/edit/", editHandler)
}

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")))
}