mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
tpl: Add hasSuffix alias
strings.HasPrefix already has an alias of hasPrefix but strings.HasSuffix has no such alias. This PR adds a hasSuffix alias to the tpl function with corresponding function documentation. It also adds a Minor update to the hasPrefix function documentation re: keywords and relatedfuncs. Completes https://github.com/gohugoio/hugo/issues/10474
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
02ab77da3e
commit
d171d1543d
@@ -104,6 +104,14 @@ func init() {
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.HasSuffix,
|
||||
[]string{"hasSuffix"},
|
||||
[][2]string{
|
||||
{`{{ hasSuffix "Hugo" "go" }}`, `true`},
|
||||
{`{{ hasSuffix "Hugo" "du" }}`, `false`},
|
||||
},
|
||||
)
|
||||
|
||||
ns.AddMethodMapping(ctx.ToLower,
|
||||
[]string{"lower"},
|
||||
[][2]string{
|
||||
|
Reference in New Issue
Block a user