From 041b6c91455b83a568e29420686cd198daf09035 Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Mon, 29 May 2017 12:03:38 -0700 Subject: [PATCH] tpl: Add uniq function --- content/templates/functions.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/content/templates/functions.md b/content/templates/functions.md index c514a4ec8..a1cf9e27b 100644 --- a/content/templates/functions.md +++ b/content/templates/functions.md @@ -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 }} + + ## Files ### readDir