Liquid Filter Reference for sort - v0.9.5
Filter Name | sort |
Group | Arrays |
Version | 0.9.5 |
Description
Sorts items in an array in case-sensitive order.
Examples
{% assign an_array = "earth, Water, air, fire" | split: ", " %}
{{ an_array | sort | join: ", " }}
Water, air, earth, fire
An optional argument specifies which property of the array’s items to use for sorting:
{% assign pages_by_title = pages | sort: "title" %}
{% for page in pages_by_title -%}
- {{ page.title }}
{% endfor %}
- About Us
- Home
- Privacy Policy
Back to Liquid Reference for 0.9.5
Back to Documentation