summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl.go
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/api/tpl.go')
-rw-r--r--srv/src/api/tpl.go8
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)
},
})