Skip to content

Filter Reference

Peter Johnson edited this page Nov 24, 2022 · 9 revisions

Filter Reference

⚠️⚠️ THIS WIKI IS BEING USED TO JOT DOWN IDEAS AT PRESENT. DON'T ASSUME ANYTHING IS FIXED. ⚠️⚠️

⚒️ MORE TO COME: Check back later

Data types ending in "ish" mean that either the data type or a value that can be converted to the type are accepted. For example "numberish" means either a number or something else that is then converted to a number, say a text value or "1.5".

Note that all data types are "textish" because they can always be rendered as text. Whether that value is meaningful or not is another matter!

abs ⛔

Returns the absolute value of a numberish value provided on its input. If the input is not numberish then an error is reported.

Parameters: none

Input type: numberish

Output type: number

Example (from the Liquid docs):

{{ -17 | abs }}
{{ 4 | abs }}

Outputs

17
4

append ⛔

Appends the text given as a parameter to the input and returns the result.

Parameter: text to be appended, type textish.

Input type: textish

Output type: text

Example (from the Liquid docs):

{{ "/my/fancy/url" | append: ".html" }}

Outputs

/my/fancy/url.html

sink ⛔

Swallows all its input and returns an empty string. Aimed for use with some special filters that create side affects where no output is required.

Input type: anything

Output type: null

Clone this wiki locally