diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2022-05-20 08:36:52 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2022-05-20 08:42:54 -0600 |
commit | 1242be7cfec1faa6a880d625307e32a1a91937ac (patch) | |
tree | c0dc03c6d384b7e6757eb6076d9208c7c038cb3f /srv/src/api/tpl.go | |
parent | 5a997781871db4c1f504e2f59e14541bb1e62dcb (diff) |
Implement posts index page
Diffstat (limited to 'srv/src/api/tpl.go')
-rw-r--r-- | srv/src/api/tpl.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/srv/src/api/tpl.go b/srv/src/api/tpl.go index 8d85de9..5e33bea 100644 --- a/srv/src/api/tpl.go +++ b/srv/src/api/tpl.go @@ -42,8 +42,12 @@ func (a *api) mustParseTpl(name string) *template.Template { tpl := template.New("").Funcs(template.FuncMap{ "BlogURL": blogURL, - "AssetURL": func(path string) string { - path = filepath.Join("assets", path) + "AssetURL": func(id string) string { + path := filepath.Join("assets", id) + return blogURL(path) + }, + "PostURL": func(id string) string { + path := filepath.Join("posts", id) return blogURL(path) }, }) |