mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 04:46:05 -04:00
tpl: Add uniq function
This commit is contained in:
parent
c2a52c1cf8
commit
041b6c9145
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user