Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/liquid/standardfilters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ def join(input, glue = ' ')
# @liquid_category array
# @liquid_summary
# Sorts the items in an array in case-sensitive alphabetical, or numerical, order.
# @liquid_description
# The sort is stable: items that compare as equal keep their original relative order.
# Pass an optional property name to sort objects by that property, for example `array | sort: "name"`.
# @liquid_syntax array | sort
# @liquid_return [array[untyped]]
def sort(input, property = nil)
Expand All @@ -421,6 +424,8 @@ def sort(input, property = nil)
# @liquid_summary
# Sorts the items in an array in case-insensitive alphabetical order.
# @liquid_description
# The sort is stable: items that compare as equal keep their original relative order.
#
# > Caution:
# > You shouldn't use the `sort_natural` filter to sort numerical values. When comparing items an array, each item is converted to a
# > string, so sorting on numerical values can lead to unexpected results.
Expand Down
Loading