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/gmi | |
parent | 0665d0c65974533fbd313f4e0b062b5103057aeb (diff) |
Get rid of most of preprocess funcs, only Image leftover for convenience
Diffstat (limited to 'src/gmi')
-rw-r--r-- | src/gmi/tpl.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/gmi/tpl.go b/src/gmi/tpl.go index cdf9535..d4c6b00 100644 --- a/src/gmi/tpl.go +++ b/src/gmi/tpl.go @@ -57,27 +57,6 @@ func (a *api) tplHandler() (gemini.Handler, error) { } preprocessFuncs := post.PreprocessFunctions{ - BlogURL: func(path string) string { - return blogURL(a.params.PublicURL, path, false) - }, - BlogHTTPURL: func(path string) string { - return blogURL(a.params.HTTPPublicURL, path, true) - }, - BlogGeminiURL: func(path string) string { - return blogURL(a.params.PublicURL, path, true) - }, - AssetURL: func(id string) string { - path := filepath.Join("assets", id) - return blogURL(a.params.PublicURL, path, false) - }, - PostURL: func(id string) string { - path := filepath.Join("posts", id) + ".gmi" - return blogURL(a.params.PublicURL, path, false) - }, - StaticURL: func(path string) string { - path = filepath.Join("static", path) - return blogURL(a.params.HTTPPublicURL, path, true) - }, Image: func(args ...string) (string, error) { var ( id = args[0] @@ -97,19 +76,6 @@ func (a *api) tplHandler() (gemini.Handler, error) { allTpls := template.New("") - allTpls.Funcs(preprocessFuncs.ToFuncMap()) - - allTpls.Funcs(template.FuncMap{ - "PostURLAbs": func(id string) string { - path := filepath.Join("posts", id) + ".gmi" - return blogURL(a.params.PublicURL, path, true) - }, - "PostHTTPURL": func(id string) string { - path := filepath.Join("posts", id) - return preprocessFuncs.BlogHTTPURL(path) - }, - }) - err := fs.WalkDir(tplFS, "tpl", func(path string, d fs.DirEntry, err error) error { if err != nil { |