mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-10-17 14:46:25 -04:00

We need to rework the whole template func docs and, while a good idea, this does not fit into that.
970 B
970 B
title | description | godocref | date | publishdate | lastmod | categories | menu | signature | workson | hugoversion | relatedfuncs | deprecated | draft | aliases | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
shuffle | Returns a random permutation of a given array or slice. | 2017-02-01 | 2017-02-01 | 2017-04-30 |
|
|
|
|
false | false |
shuffle
returns a random permutation of a given array or slice:
{{% code file="shuffle-input.html" %}}
<!-- Shuffled sequence = -->
<div>{{ shuffle (seq 1 5) }}</div>
<!-- Shuffled slice = -->
<div>{{ shuffle (slice "foo" "bar" "buzz") }}</div>
{{% /code %}}
This example would return the following:
{{% output file="shuffle-output.html" %}}
<!-- Shuffled sequence = -->
<div>2 5 3 1 4</div>
<!-- Shuffled slice = -->
<div>buzz foo bar</div>
{{% /output %}}