From 332e983da476974805a3a0d53bfedaebe73a9fcb Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 19 May 2024 22:14:25 +0200 Subject: Get rid of most of preprocess funcs, only Image leftover for convenience --- src/http/tpl.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/http/tpl.go') diff --git a/src/http/tpl.go b/src/http/tpl.go index c4afbdc..57d7cfd 100644 --- a/src/http/tpl.go +++ b/src/http/tpl.go @@ -90,25 +90,12 @@ func (a *api) draftsURL(abs bool) string { return a.blogURL(a.params.PublicURL, "drafts", abs) } -func (a *api) tplFuncs() template.FuncMap { - return template.FuncMap{ - "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(a.postPreprocessFuncs().ToFuncMap()) - return tpl -} - func mustParseTpl(tpl *template.Template, name string) *template.Template { return template.Must(tpl.New(name).Parse(mustReadTplFile(name))) } func (a *api) mustParseBasedTpl(name string) *template.Template { - tpl := a.emptyTpl() + tpl := template.New("") tpl = mustParseTpl(tpl, "gemini-cta.html") tpl = mustParseTpl(tpl, "base.html") tpl = mustParseTpl(tpl, name) -- cgit v1.2.3