projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3ea4b4
)
Let Amber template call Hugo's custom functions
author
Tatsushi Demachi
<tdemachi@gmail.com>
Mon, 20 Jul 2015 00:07:55 +0000
(09:07 +0900)
committer
Bjørn Erik Pedersen
<bjorn.erik.pedersen@gmail.com>
Mon, 20 Jul 2015 09:29:15 +0000
(11:29 +0200)
Amber doesn't share text/template `FuncMap` functions and has its own
function list. This allows Amber to call Hugo's custom functions.
tpl/template.go
patch
|
blob
|
history
diff --git
a/tpl/template.go
b/tpl/template.go
index 60fc91746fd56a3515aef339efcb4c1bd833d8d8..357a9fbd2a0aed6df17188c65ceda67bc5f18fa6 100644
(file)
--- 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