mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
tpl: Add strings.TrimLeft and TrimRight
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
08f48b91d6
commit
7674ad7382
@@ -112,6 +112,20 @@ func init() {
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.TrimLeft,
|
||||
nil,
|
||||
[][2]string{
|
||||
{`{{ "aabbaa" | strings.TrimLeft "a" }}`, `bbaa`},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.TrimRight,
|
||||
nil,
|
||||
[][2]string{
|
||||
{`{{ "aabbaa" | strings.TrimRight "a" }}`, `aabb`},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.Title,
|
||||
[]string{"title"},
|
||||
[][2]string{
|
||||
|
Reference in New Issue
Block a user