mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Avoid reading from Viper for path and URL funcs
The gain, given the "real sites benchmark" below, is obvious: ``` benchmark old ns/op new ns/op delta BenchmarkHugo-4 14497594101 13084156335 -9.75% benchmark old allocs new allocs delta BenchmarkHugo-4 57404335 48282002 -15.89% benchmark old bytes new bytes delta BenchmarkHugo-4 9933505624 9721984424 -2.13% ``` Fixes #2495
This commit is contained in:
committed by
GitHub
parent
dffd7da07c
commit
a10b2cd372
@@ -94,6 +94,10 @@ func New() Template {
|
||||
|
||||
localTemplates = &templates.Template
|
||||
|
||||
// The URL funcs in the funcMap is somewhat language dependent,
|
||||
// so need to be reinit per site.
|
||||
initFuncMap()
|
||||
|
||||
for k, v := range funcMap {
|
||||
amber.FuncMap[k] = v
|
||||
}
|
||||
|
Reference in New Issue
Block a user