Used to get the first element of arrays and strings:
Used to get the first element of arrays and strings:
html
{% assign array = "1,2,3,4,5" | split: "," %}
{{ array | first }}
The above snippet will render "1"
Used to reverse arrays:
Used to reverse arrays:
html
{% assign array = "1,2,3,4,5" | split: "," %}
{{ array | reverse }}
Custom liquid template filters