1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

tpl: Add uniq function

This commit is contained in:
Nathan Sharfi
2017-05-29 12:03:38 -07:00
committed by Bjørn Erik Pedersen
parent 46b4607828
commit e28d9aa42c
4 changed files with 89 additions and 0 deletions

View File

@@ -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