commit 03a70161047f33b491b300fbbc76f71ff3d34218
parent e3ea4b48a274770d8a45fe7c1dbbce2340ec4e2d
Author: Tatsushi Demachi <tdemachi@gmail.com>
Date: Mon, 20 Jul 2015 09:07:55 +0900
Let Amber template call Hugo's custom functions
Amber doesn't share text/template `FuncMap` functions and has its own
function list. This allows Amber to call Hugo's custom functions.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/tpl/template.go b/tpl/template.go
@@ -82,6 +82,9 @@ func New() Template {
localTemplates = &templates.Template
+ for k, v := range funcMap {
+ amber.FuncMap[k] = v
+ }
templates.Funcs(funcMap)
templates.LoadEmbedded()
return templates