mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 14:17:43 +00:00
tpl: Add uniq function
This commit is contained in:
1 parent
c2a52c1cf8
commit
041b6c9145
1 file changed
+9
@@ -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