mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
tpl: Add method mappings for strings.Contains, strings.ContainsAny
Just to confirm/document the function signature.
This commit is contained in:
parent
01dd7c16af
commit
7f8530039a
1 changed files with 16 additions and 0 deletions
|
@ -58,6 +58,22 @@ func init() {
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ns.AddMethodMapping(ctx.Contains,
|
||||||
|
nil,
|
||||||
|
[][2]string{
|
||||||
|
{`{{ strings.Contains "abc" "b" }}`, `true`},
|
||||||
|
{`{{ strings.Contains "abc" "d" }}`, `false`},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
ns.AddMethodMapping(ctx.ContainsAny,
|
||||||
|
nil,
|
||||||
|
[][2]string{
|
||||||
|
{`{{ strings.ContainsAny "abc" "bcd" }}`, `true`},
|
||||||
|
{`{{ strings.ContainsAny "abc" "def" }}`, `false`},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
ns.AddMethodMapping(ctx.FindRE,
|
ns.AddMethodMapping(ctx.FindRE,
|
||||||
[]string{"findRE"},
|
[]string{"findRE"},
|
||||||
[][2]string{
|
[][2]string{
|
||||||
|
|
Loading…
Reference in a new issue