Shuffle filter

Is there a shuffle filter to sort an array in a random order?

No random filters no

More or less. I use this code to display a random string in my header:

<h2>{{ config.extra.header_subtexts | nth(n=get_random(start=1, end=config.extra.header_subtexts | length)) }}</h2>

config.toml:

[extra]
header_subtexts = ["string1", "string2", "string3"]

Works for me.

3 Likes