ref: 38d034df38b385d50160071f794cf3331b5cda24
parent: 6eff9e501534dfa952b059f446faf9eff097aef7
author: digitalcraftsman <[email protected]>
date: Mon Aug 29 08:22:37 EDT 2016
docs: Document shuffle template func Fixes #2393.
--- a/docs/content/templates/functions.md
+++ b/docs/content/templates/functions.md
@@ -97,6 +97,18 @@
```
+### shuffle
+
+`shuffle` returns a random permutation of a given array or slice, e.g.
+
+```html
+{{ shuffle (seq 1 5) }}
+<!-- returns [2 5 3 1 4] -->
+
+{{ shuffle (slice "foo" "bar" "buzz") }}
+<!-- returns [buzz foo bar] -->
+```
+
### echoParam
Prints a parameter if it is set.
@@ -128,7 +140,7 @@
e.g.
- {{ dict "title" .Title "content" .Plain | jsonify }}
+ {{ dict "title" .Title "content" .Plain | jsonify }}
### last
Slices an array to only the last _N_ elements.