Commit d924b577 authored by Las Zenow's avatar Las Zenow

Move templates

parent 48d1997f
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
......@@ -5,9 +5,19 @@ import (
"net/http"
)
const (
TEMPLATE_DIR = "templates/"
)
func loadTemplate(w http.ResponseWriter, tmpl string, data interface{}) {
// TODO: when finish devel conver to global:
var templates = template.Must(template.ParseFiles("header.html", "footer.html", "index.html", "about.html", "book.html", "search.html", "upload.html"))
var templates = template.Must(template.ParseFiles(TEMPLATE_DIR + "header.html",
TEMPLATE_DIR + "footer.html",
TEMPLATE_DIR + "index.html",
TEMPLATE_DIR + "about.html",
TEMPLATE_DIR + "book.html",
TEMPLATE_DIR + "search.html",
TEMPLATE_DIR + "upload.html"))
err := templates.ExecuteTemplate(w, tmpl+".html", data)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment