aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/partials
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2017-10-07 16:52:35 +0200
committerBjørn Erik Pedersen <[email protected]>2017-10-07 16:53:01 +0200
commite2e8bcbec34702a27047b91b6b007a15f1fc0797 (patch)
tree53cee4bb93eabec77395a9e9ea5995a934135ab4 /tpl/partials
parent66a169a24967681dbf91dad6e1f9fd5dd624d95e (diff)
downloadhugo-e2e8bcbec34702a27047b91b6b007a15f1fc0797.tar.gz
hugo-e2e8bcbec34702a27047b91b6b007a15f1fc0797.zip
tpl: Rework the partial test and benchmarks
Diffstat (limited to 'tpl/partials')
-rw-r--r--tpl/partials/init.go2
-rw-r--r--tpl/partials/partials.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/tpl/partials/init.go b/tpl/partials/init.go
index eca93783c..b68256a9a 100644
--- a/tpl/partials/init.go
+++ b/tpl/partials/init.go
@@ -36,7 +36,7 @@ func init() {
},
)
- ns.AddMethodMapping(ctx.getCached,
+ ns.AddMethodMapping(ctx.IncludeCached,
[]string{"partialCached"},
[][2]string{},
)
diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go
index cf89bad37..da131a974 100644
--- a/tpl/partials/partials.go
+++ b/tpl/partials/partials.go
@@ -88,11 +88,11 @@ func (ns *Namespace) Include(name string, contextList ...interface{}) (interface
return "", fmt.Errorf("Partial %q not found", name)
}
-// getCached executes and caches partial templates. An optional variant
+// IncludeCached executes and caches partial templates. An optional variant
// string parameter (a string slice actually, but be only use a variadic
// argument to make it optional) can be passed so that a given partial can have
// multiple uses. The cache is created with name+variant as the key.
-func (ns *Namespace) getCached(name string, context interface{}, variant ...string) (interface{}, error) {
+func (ns *Namespace) IncludeCached(name string, context interface{}, variant ...string) (interface{}, error) {
key := name
if len(variant) > 0 {
for i := 0; i < len(variant); i++ {