summaryrefslogtreecommitdiffstats
path: root/tpl/tplimpl
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-30 19:33:19 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-05-01 15:13:41 +0200
commita3bf118eaa0796892047bb7456fe89824e423f27 (patch)
treeabe34c808992bc84e4fb6476c670ac246eca52c7 /tpl/tplimpl
parent656155736721547fef45466a28295f6a563cdd1f (diff)
tpl/compare: Make it a package that stands on its own
See #3042
Diffstat (limited to 'tpl/tplimpl')
-rw-r--r--tpl/tplimpl/template_funcs.go9
-rw-r--r--tpl/tplimpl/template_funcs_test.go2
2 files changed, 1 insertions, 10 deletions
diff --git a/tpl/tplimpl/template_funcs.go b/tpl/tplimpl/template_funcs.go
index 3e4fc558a..d56cc661b 100644
--- a/tpl/tplimpl/template_funcs.go
+++ b/tpl/tplimpl/template_funcs.go
@@ -21,10 +21,10 @@ import (
"sync"
"github.com/spf13/cast"
- "github.com/spf13/hugo/tpl/compare"
"github.com/spf13/hugo/tpl/internal"
// Init the namespaces
+ _ "github.com/spf13/hugo/tpl/compare"
_ "github.com/spf13/hugo/tpl/data"
_ "github.com/spf13/hugo/tpl/lang"
_ "github.com/spf13/hugo/tpl/math"
@@ -99,17 +99,13 @@ func (t *templateFuncster) initFuncMap() {
"apply": t.collections.Apply,
"base64Decode": t.encoding.Base64Decode,
"base64Encode": t.encoding.Base64Encode,
- "default": compare.Default,
"dateFormat": t.time.Format,
"delimit": t.collections.Delimit,
"dict": t.collections.Dictionary,
"echoParam": t.collections.EchoParam,
"emojify": t.transform.Emojify,
- "eq": compare.Eq,
"first": t.collections.First,
- "ge": compare.Ge,
"getenv": t.os.Getenv,
- "gt": compare.Gt,
"highlight": t.transform.Highlight,
"htmlEscape": t.transform.HTMLEscape,
"htmlUnescape": t.transform.HTMLUnescape,
@@ -123,11 +119,8 @@ func (t *templateFuncster) initFuncMap() {
"isset": t.collections.IsSet,
"jsonify": t.encoding.Jsonify,
"last": t.collections.Last,
- "le": compare.Le,
- "lt": compare.Lt,
"markdownify": t.transform.Markdownify,
"md5": t.crypto.MD5,
- "ne": compare.Ne,
"now": t.time.Now,
"partial": t.partial,
"partialCached": t.partialCached,
diff --git a/tpl/tplimpl/template_funcs_test.go b/tpl/tplimpl/template_funcs_test.go
index 3b2600b1b..49a7363d9 100644
--- a/tpl/tplimpl/template_funcs_test.go
+++ b/tpl/tplimpl/template_funcs_test.go
@@ -132,7 +132,6 @@ dateFormat: {{ dateFormat "Monday, Jan 2, 2006" "2015-01-21" }}
delimit: {{ delimit (slice "A" "B" "C") ", " " and " }}
echoParam: {{ echoParam .Params "langCode" }}
emojify: {{ "I :heart: Hugo" | emojify }}
-eq: {{ if eq .Section "blog" }}current{{ end }}
htmlEscape 1: {{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | safeHTML}}
htmlEscape 2: {{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>"}}
htmlUnescape 1: {{htmlUnescape "Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | safeHTML}}
@@ -189,7 +188,6 @@ dateFormat: Wednesday, Jan 21, 2015
delimit: A, B and C
echoParam: en
emojify: I ❤️ Hugo
-eq: current
htmlEscape 1: Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;
htmlEscape 2: Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;
htmlUnescape 1: Cathal Garvey & The Sunshine Band <cathal@foo.bar>