From 1242be7cfec1faa6a880d625307e32a1a91937ac Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 20 May 2022 08:36:52 -0600 Subject: Implement posts index page --- srv/src/api/tpl.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'srv/src/api/tpl.go') 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) }, }) -- cgit v1.2.3