package main
import (
"fmt"
"html/template"
"log"
"net/http"
)
func servetemplate(w http.ResponseWriter, f string, d templatedata) {
t, err := template.ParseFiles(conf.tmplpath + "/" + f)
if err != nil {
http.Error(w, "Internal error", http.StatusInternalServerError)
return
}
if verbose {
log.Printf("Serving template %s", t.Name())
}
err = t.Execute(w, d)
if err != nil {
fmt.Println(err)
}
}