diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2024-05-19 22:14:25 +0200 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2024-05-19 22:14:25 +0200 |
commit | 332e983da476974805a3a0d53bfedaebe73a9fcb (patch) | |
tree | 1956248d86fc07c0193ffdeea77469655fd69c8a /src/http/tpl.go | |
parent | 0665d0c65974533fbd313f4e0b062b5103057aeb (diff) |
Get rid of most of preprocess funcs, only Image leftover for convenience
Diffstat (limited to 'src/http/tpl.go')
-rw-r--r-- | src/http/tpl.go | 15 |
1 files changed, 1 insertions, 14 deletions
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) |