sort
Sort elements of an array in standard ascending case-sensitive alphabetical order.
Syntax
{{ array | sort: property }}Example
{% assign items = "Denver,Austin,Boston" | split: "," %}{{ items | sort | join: ", " }}Output
Austin, Boston, DenverThe sort filter reorders array elements in ascending case-sensitive alphabetical or numerical order. When sorting collections of objects, an optional property name argument specifies the key to sort by.
In programmatic SEO directories, sort arranges related cities, technician names, or supported integrations in alphabetical order for intuitive visitor browsing. For example: {{ row.nearby_towns | split: ',' | sort | join: ', ' }}. This delivers structured, predictable navigation links that search engine spiders can catalog systematically.
Filters
- abs
- append
- at_least
- at_most
- capitalize
- ceil
- compact
- concat
- date
- default
- divided_by
- downcase
- escape
- escape_once
- first
- floor
- join
- last
- lstrip
- map
- minus
- modulo
- newline_to_br
- plus
- prepend
- remove
- remove_first
- replace
- replace_first
- reverse
- round
- rstrip
- size
- slice
- sort
- sort_natural
- split
- strip
- strip_html
- strip_newlines
- times
- truncate
- truncatewords
- uniq
- upcase
- url_decode
- url_encode
- where
- raw
- slugify
- number_format
