diff options
Diffstat (limited to 'src/http/tpl.go')
-rw-r--r-- | src/http/tpl.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/http/tpl.go b/src/http/tpl.go index a9f89d7..f49232a 100644 --- a/src/http/tpl.go +++ b/src/http/tpl.go @@ -61,6 +61,11 @@ func (a *api) manageAssetsURL(abs bool) string { return a.blogURL("assets?method=manage", abs) } +func (a *api) assetURL(id string, abs bool) string { + path := filepath.Join("assets", id) + return a.blogURL(path, false) +} + func (a *api) draftPostURL(id string, abs bool) string { path := filepath.Join("drafts", id) return a.blogURL(path, abs) @@ -96,8 +101,7 @@ func (a *api) tplFuncs() template.FuncMap { return a.postURL(id, false) }, "AssetURL": func(id string) string { - path := filepath.Join("assets", id) - return a.blogURL(path, false) + return a.assetURL(id, false) }, "DraftURL": func(id string) string { return a.draftPostURL(id, false) |