mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 23:38:53 +00:00
Update slice.md
Should include simple case. By combining in to a single step with the delimit function it confuses that this is the reference for the slice function. My solution is just to add an interim step illustrating the simple case and feeding that back into the delimit function.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
533e4e0cd5
commit
9f61dac7af
@@ -23,7 +23,9 @@ 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") ", " }}
|
||||
{{ $sliceOfStrings := slice "foo" "bar" "buzz" }}
|
||||
<!-- returns the slice [ "foo", "bar", "buzz"] -->
|
||||
{{ delimit ($sliceOfStrings) ", " }}
|
||||
<!-- returns the string "foo, bar, buzz" -->
|
||||
{{< /code >}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user