From 034fd4adc12761d153490341957fff9b52ca862a Mon Sep 17 00:00:00 2001 From: digitalcraftsman Date: Sat, 27 Feb 2016 16:51:07 +0100 Subject: [PATCH] Add template function slice --- content/templates/functions.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/content/templates/functions.md b/content/templates/functions.md index 67537c70c..146ab8e93 100644 --- a/content/templates/functions.md +++ b/content/templates/functions.md @@ -75,6 +75,18 @@ or Create a map on the fly to pass into +### slice + +`slice` allows you to create an array (`[]interface{}`) of all arguments that you pass to this function. + +One use case is the concatenation of elements in combination with `delimit`: + +```html +{{ delimit (slice "foo" "bar" "buzz") ", " }} + +``` + + ### echoParam Prints a parameter if it is set.