diff --git a/content/en/functions/collections/Shuffle.md b/content/en/functions/collections/Shuffle.md index 3a27c099a..a2cb03b24 100644 --- a/content/en/functions/collections/Shuffle.md +++ b/content/en/functions/collections/Shuffle.md @@ -12,8 +12,37 @@ aliases: [/functions/shuffle] --- ```go-html-template -{{ shuffle (seq 1 2 3) }} → [3 1 2] -{{ shuffle (slice "a" "b" "c") }} → [b a c] +{{ collections.Shuffle (seq 1 2 3) }} → [3 1 2] +{{ collections.Shuffle (slice "a" "b" "c") }} → [b a c] ``` The result will vary from one build to the next. + +To render an unordered list of 5 random pages from a page collection: + +```go-html-template + +``` + +For better performance with large collections, use the [`math.Rand`] and [`collections.Index`] functions instead: + +```go-html-template + +``` + +[`collections.Index`]:/functions/collections/indexfunction/ +[`math.Rand`]: /functions/math/rand/