mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
tpl: Add uniq function
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
46b4607828
commit
e28d9aa42c
@@ -137,6 +137,12 @@ func init() {
|
||||
{`{{ seq 3 }}`, `[1 2 3]`},
|
||||
},
|
||||
)
|
||||
ns.AddMethodMapping(ctx.Uniq,
|
||||
[]string{"uniq"},
|
||||
[][2]string{
|
||||
{`{{ slice 1 2 3 2 | uniq }}`, `[1 2 3]`},
|
||||
},
|
||||
)
|
||||
|
||||
return ns
|
||||
|
||||
|
Reference in New Issue
Block a user