summaryrefslogtreecommitdiff
path: root/src/http/tpl.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/tpl.go')
-rw-r--r--src/http/tpl.go18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/http/tpl.go b/src/http/tpl.go
index afd4c8e..2711259 100644
--- a/src/http/tpl.go
+++ b/src/http/tpl.go
@@ -12,7 +12,6 @@ import (
"net/url"
"path/filepath"
"strings"
- "time"
"dev.mediocregopher.com/mediocre-blog.git/src/http/apiutil"
"dev.mediocregopher.com/mediocre-blog.git/src/post"
@@ -93,27 +92,14 @@ func (a *api) draftsURL(abs bool) string {
func (a *api) tplFuncs() template.FuncMap {
return template.FuncMap{
- "StaticInlineCSS": func(path string) (template.CSS, error) {
- path = filepath.Join("static", path)
- b, err := staticFS.ReadFile(path)
- return template.CSS(b), err
- },
- "DraftURL": func(id string) string {
- return a.draftPostURL(id, false)
- },
- "DateTimeFormat": func(t time.Time) string {
- return t.Format("2006-01-02")
- },
- "SafeURL": func(u string) template.URL {
- return template.URL(u)
- },
+ "DraftURL": func(id string) string { return a.draftPostURL(id, false) },
}
}
func (a *api) emptyTpl() *template.Template {
tpl := template.New("")
tpl = tpl.Funcs(a.tplFuncs())
- tpl = tpl.Funcs(template.FuncMap(a.postPreprocessFuncs().ToFuncMap()))
+ tpl = tpl.Funcs(a.postPreprocessFuncs().ToFuncMap())
return tpl
}