hugo/tpl
Bjørn Erik Pedersen a03c631c42
Rework template handling for function and map lookups
This is a big commit, but it deletes lots of code and simplifies a lot.

* Resolving the template funcs at execution time means we don't have to create template clones per site
* Having a custom map resolver means that we can remove the AST lower case transformation for the special lower case Params map

Not only is the above easier to reason about, it's also faster, especially if you have more than one language, as in the benchmark below:

```
name                          old time/op    new time/op    delta
SiteNew/Deep_content_tree-16    53.7ms ± 0%    48.1ms ± 2%  -10.38%  (p=0.029 n=4+4)

name                          old alloc/op   new alloc/op   delta
SiteNew/Deep_content_tree-16    41.0MB ± 0%    36.8MB ± 0%  -10.26%  (p=0.029 n=4+4)

name                          old allocs/op  new allocs/op  delta
SiteNew/Deep_content_tree-16      481k ± 0%      410k ± 0%  -14.66%  (p=0.029 n=4+4)
```

This should be even better if you also have lots of templates.

Closes #6594
2019-12-12 10:04:35 +01:00
..
cast Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00
collections Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
compare tpl: Remove eq argument limitation 2019-09-05 14:38:47 +02:00
crypto tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
data Prepare for Goldmark 2019-11-06 19:09:08 +01:00
encoding tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
fmt tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
hugo tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
images Allow slices in the image Filter funcs, not just varargs 2019-09-04 17:24:50 +02:00
inflect tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
internal Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
lang tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
math tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
os tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
partials Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
path tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
reflect tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
resources Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
safe Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00
site tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
strings Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00
templates tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
time tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
tplimpl Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
transform Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00
urls Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00
template.go Rework template handling for function and map lookups 2019-12-12 10:04:35 +01:00
template_info.go tpl: Allow the partial template func to return any type 2019-04-02 10:30:24 +02:00
template_test.go Create lightweight forks of text/template and html/template 2019-12-12 09:59:34 +01:00