diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5c93f45 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ + 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. diff --git a/template.go b/template.go index 358a1b2..ab0b5e1 100644 --- a/template.go +++ b/template.go @@ -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 { diff --git a/about.html b/templates/about.html similarity index 100% rename from about.html rename to templates/about.html diff --git a/book.html b/templates/book.html similarity index 100% rename from book.html rename to templates/book.html diff --git a/footer.html b/templates/footer.html similarity index 100% rename from footer.html rename to templates/footer.html diff --git a/header.html b/templates/header.html similarity index 100% rename from header.html rename to templates/header.html diff --git a/index.html b/templates/index.html similarity index 100% rename from index.html rename to templates/index.html diff --git a/search.html b/templates/search.html similarity index 100% rename from search.html rename to templates/search.html diff --git a/upload.html b/templates/upload.html similarity index 100% rename from upload.html rename to templates/upload.html