2017-03-27 16:32:31 -05:00

782 B

title linktitle description godocref date publishdate lastmod categories tags ns signature workson hugoversion relatedfuncs deprecated draft aliases toc needsexamples
slice slice Creates an array (`[]interface{}``) of all passed arguments. 2017-02-01 2017-02-01 2017-02-01
functions
slice
array
interface
slice ITEM...
false false
false true

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 the delimit function:

{{% code file="slice.html" %}}

{{ delimit (slice "foo" "bar" "buzz") ", " }}
<!-- returns the string "foo, bar, buzz" -->

{{% /code %}}