mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Merge commit '83bef6955e014d40c0f00db9cebe09113154e999'
This commit is contained in:
32
docs/content/en/functions/slice.md
Normal file
32
docs/content/en/functions/slice.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
title: slice
|
||||
# linktitle: slice
|
||||
description: Creates a slice (array) of all passed arguments.
|
||||
godocref:
|
||||
date: 2017-02-01
|
||||
publishdate: 2017-02-01
|
||||
lastmod: 2017-02-01
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: "functions"
|
||||
keywords: [slice, array, interface]
|
||||
signature: ["slice ITEM..."]
|
||||
workson: []
|
||||
hugoversion:
|
||||
relatedfuncs: []
|
||||
deprecated: false
|
||||
draft: false
|
||||
aliases: []
|
||||
toc: false
|
||||
---
|
||||
|
||||
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 >}}
|
||||
|
||||
|
||||
[`delimit` function]: /functions/delimit/
|
Reference in New Issue
Block a user