Testing the Nunjucks sort filter in Eleventy for sorting arrays of numbers, strings, and objects.
Sort arr
with JavaScript's arr.sort
function.
If reverse
is true
, result will be reversed.
Sort is case-insensitive by default, but setting caseSens
to true
makes it case-sensitive.
If attr
is passed, will compare attr
from each item.