Liquid Templates

Created: 2023-09-03T13:23:33-05:00

=> Return to the Index
=> This card pertains to a resource available on the internet.

only read about half or less. the basic idea is simple enough but there is actually quite a bit here to implement.

Objects: inserts someting in the page. Text inside of {{ and }}'s.

Filters: modifies values before sending them out to the user. These are specified inside objects, using pipes. Such as {{post | capitalize}}.

Tags: controls conditional rendering. Text inside of {% and %}'s.

Operators: ==, !=, >, <, >=, <=, or, and

Operators are checked right to left. Parenthesis are not allowed, so you can't change grouping.

All values are true except nil and false. Empty strings are still true.

Types: Strings, Numbers, Boolean, Nil, Array, EmptyDrop

EmptyDrop: a nil type that represents deleted or not-found data; ex. when looping over paginated data.

empty: you can check values against empty. comparing == empty is true if an array or string has zero elements.

Whitespace control: if a dash appears in a brace pair, whitespace is consumed from that side. {{-, -}}, {%-, and -%}

if 
elsif 
else 
endif

for  in 
break    # exit loop early
continue # next iteration
else
.. code path if array is empty
endfor

# can include parameters
for  in  limit:2 offset:3 reversed

assign  = 
assign  = (low..high) # ranges

comment
.. stuff
endcomment
Proxy Information
Original URL
gemini://iceworks.cc/z/clm3s71d50000ahuqgvt22nnj.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
630.034443 milliseconds
Gemini-to-HTML Time
0.398491 milliseconds

This content has been proxied by September (ba2dc).