mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
tpl: Add uniq function
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
46b4607828
commit
e28d9aa42c
@@ -373,6 +373,15 @@ e.g.
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
### uniq
|
||||
|
||||
Takes in a slice or array and returns a slice with subsequent duplicate elements removed.
|
||||
|
||||
{{ uniq (slice 1 2 3 2) }}
|
||||
{{ slice 1 2 3 2 | uniq }}
|
||||
<!-- both return [1 2 3] -->
|
||||
|
||||
## Files
|
||||
|
||||
### readDir
|
||||
|
Reference in New Issue
Block a user