diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-10-18 20:37:00 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-10-18 20:39:12 -0300 |
| commit | 48375acd7d6581b42b354618ed694a9d1cd25439 (patch) | |
| tree | bd4fa70e4d39b3d637b218bbe7f52b86a96a1522 /templates.go | |
| parent | cd93a7c2bf927fd747fc188bdda98ea03b1f5e72 (diff) | |
| download | web-48375acd7d6581b42b354618ed694a9d1cd25439.tar.gz web-48375acd7d6581b42b354618ed694a9d1cd25439.zip | |
overall improvements + keep up with querymanager v0.2
Diffstat (limited to 'templates.go')
| -rw-r--r-- | templates.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/templates.go b/templates.go index 1f47782..5281c14 100644 --- a/templates.go +++ b/templates.go @@ -58,7 +58,13 @@ var ( func InitTemplates() bool { var Err error - g_Templates, Err = template.ParseGlob("templates/*.tmpl") + + CustomFuncs := template.FuncMap{ + "FormatTimestamp": FormatTimestamp, + "FormatDurationSince": FormatDurationSince, + } + + g_Templates, Err = template.New("").Funcs(CustomFuncs).ParseGlob("templates/*.tmpl") if Err != nil { g_LogErr.Printf("Failed to parse templates: %v", Err) return false |
