Filters.
The standard Liquid filters are all available. FleekSite adds filters for prices and currency, dates, strings, arrays, JSON and images. A few standard filters behave differently in compat mode; those are called out at the end.
Standard filters
Available from LiquidJS: default, escape / escape_once, strip / lstrip / rstrip, split, join, append, prepend, replace / replace_first, remove / remove_first, downcase, capitalize, slice, url_encode / url_decode, plus, minus, times, divided_by, modulo, abs, at_least, at_most, ceil, floor, round, compact, concat, first, last, size, sort, sort_natural, reverse, map, where, newline_to_br, strip_html, strip_newlines and date. Three more (truncate, truncatewords, upcase) are standard names FleekSite overrides in compat mode; see below.
Price and currency
| Filter | Result |
|---|---|
price | Formats a number as a two-decimal string ("1300.00"). Any value below 1.00 floors to "0.00". |
exchange: from, to | Converts an amount between currencies, for example {{ price | exchange: 'USD', 'JMD' }}. Returns nothing on a failed conversion. |
{{ product.price | price }} {% comment %} 1300.00 {% endcomment %}
{{ product.price | exchange: 'USD', site.currency | price }}A post's price is already a two-decimal string in the context, so | price is only needed on raw numbers.
Dates and time
| Filter | Result |
|---|---|
custom_date | Formats a date, default pattern dd.MM.yyyy. Pass a pattern: {{ post.inserted_at | custom_date: 'dd MMM yyyy' }}. |
time_ago | A relative phrase, for example "3 days ago". |
from_unix | Converts a Unix timestamp (seconds) to an ISO string. |
All dates are formatted as UTC wall-clock time. The standard date filter is also available.
Strings
| Filter | Result |
|---|---|
strip_tags | Removes HTML tags. A nil input returns an empty string (not nil), which matters when the result feeds a condition or a collection filter. |
camelcase | Capitalises the first letter of each word. |
friendly_number | Groups thousands with a thin space. |
md | Renders a small subset of Markdown (bold, italic, links, headings, line breaks) to HTML. |
like: other | A fuzzy string match, true when the two strings are close enough. |
Maths
Null-safe arithmetic that treats missing operands as zero, alongside the standard plus / minus / times / divided_by:
| Filter | Result |
|---|---|
add: n / subtract: n | Addition and subtraction, nil-safe. |
multiply: n / divide: n | Multiplication and division. Dividing by zero returns the input unchanged. |
parse_int / parse_float | Parse a value to a number, defaulting to zero. |
random_num | A random integer from 1 to 999999. |
Arrays and maps
| Filter | Result |
|---|---|
chunk: n | Splits an array into groups of n. |
filter_list: key, value | Keeps items whose key equals value. |
uniq | Removes duplicates. |
contains: item / holds: item | True when an array includes the item, or a string contains the substring. |
list_wrap | Wraps a non-array value in an array. |
random | A random element of an array. |
take: "a,b,c" | Picks those keys from a map. |
map_to_list | Turns a map into a list of key and value pairs. |
JSON and images
| Filter | Result |
|---|---|
json_encode | Serialises a value to a JSON string. |
json_decode | Parses a JSON string to a value. |
put: key, value | Returns a copy of a map with a key set. |
uri_encode | Turns a map into a URL query string. |
resize: "WxH" | Rewrites an image URL to a resized version through the image CDN, for example {{ product.primary_media.url | resize: '600x600' }}. |
crop: "WxH", gravity | A cropped variant of an image, with an optional gravity. |
Compat overrides
Three standard filter names carry the older engine's behaviour in Compat mode. In Standard mode they are the LiquidJS built-ins.
| Filter | Compat | Standard |
|---|---|---|
truncate: n | Cuts a few characters short of n and counts by grapheme; truncates a string that already fits | The Shopify-standard truncate |
truncatewords: n | Splits on single spaces only; ellipsis is fixed | The Shopify-standard truncatewords |
upcase | Coerces any input through a string conversion | The LiquidJS upcase |
If a truncated string looks a few characters short on a compat site, this is why. See Render modes.