aboutsummaryrefslogtreecommitdiff
path: root/backend/data.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/data.go')
-rw-r--r--backend/data.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/backend/data.go b/backend/data.go
index 3635a7e..241f47a 100644
--- a/backend/data.go
+++ b/backend/data.go
@@ -68,12 +68,7 @@ func (d *data) handleGeneric(w http.ResponseWriter, r *http.Request, name string
d.URL = r.URL.Path
}
t, err := template.New("").Funcs(template.FuncMap{
- "static": func(path string) string {
- if regexIsHttp.MatchString(path) {
- return path
- }
- return fmt.Sprintf("/static/%s", path)
- },
+ "static": getStatic,
"fullStatic": func(path string) string {
if regexIsHttp.MatchString(path) {
return path
@@ -123,3 +118,10 @@ func (d *data) Title() string {
func (d *data) PubDate() string {
return ""
}
+
+func getStatic(path string) string {
+ if regexIsHttp.MatchString(path) {
+ return path
+ }
+ return fmt.Sprintf("/static/%s", path)
+}