mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-10 19:21:24 +00:00
887 B
887 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 |
{{< code file="shuffle-input.html" >}}
{{ shuffle (seq 1 5) }}
{{ shuffle (slice "foo" "bar" "buzz") }}
{{< /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 %}}