diff options
Diffstat (limited to 'data.go')
-rw-r--r-- | data.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -61,7 +61,10 @@ func NewData(ctx context.Context, url, token string, num int) *Data { ctx: ctx, num: num, } - data.tmpl = template.Must(template.New("index").ParseFS(content, "*.tmpl")) + funcMap := map[string]any{ + "OrderedBy": OrderedBy, + } + data.tmpl = template.Must(template.New("index").Funcs(funcMap).ParseFS(content, "*.tmpl")) return data } |