Files
hugo/content/functions/slice.md
T
Bjørn Erik Pedersen 4e0bca2b1e Remove the needsexamples construct
We need to rework the whole template func docs and, while a good idea, this does not fit into that.
2017-07-16 15:13:35 +02:00

799 B

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

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 %}}