Filters #
Filters transform a variable value. Chain multiple filters with |:
{{ title | truncate: 30 | upcase }}
| Syntax | Description · Example |
|---|---|
|
Converts to uppercase. "sale" → "SALE" |
|
Converts to lowercase. "SALE" → "sale" |
|
Uppercases the first character, lowercases the rest. "hELLO" → "Hello" |
|
Removes leading and trailing whitespace. " hi " → "hi" |
|
Adds a string before the value. "world" → "prefixworld" |
|
Adds a string after the value. "hello" → "hellosuffix" |
|
Replaces every occurrence of the first argument with the second. "a and b" → "a & b" |
|
Truncates to N characters total — the ellipsis ("...") counts toward the limit. "Hello World" | truncate: 8 → "Hello..." |
|
Truncates with a custom ellipsis string. "Hello World" | truncate: 7, "…" → "Hello W…" |
|
Truncates to at most N words. "one two three four" | truncatewords: 2 → "one two..." |
|
Returns the fallback value when the variable is empty or undefined. "" | default: "N/A" → "N/A" |
|
Rounds to the nearest integer. Non-numeric input is returned unchanged. "3.7" → "4" |
|
Rounds to N decimal places. "3.14159" | round: 2 → "3.14" |
|
Rounds up to the nearest integer. "4.1" → "5" |
|
Rounds down to the nearest integer. "4.9" → "4" |
Conditional blocks #
{% if variable %}...{% endif %}
Renders the block when the variable is present and non-empty.
{% if price > 0 %}...{% endif %}
Numeric comparison. Operators: >, <, >=, <=, ==, !=. Evaluates to false when the variable is not numeric.
{% if vendor == "Nike" %}...{% endif %}
String comparison (case-sensitive). Operators: ==, !=.
{% if variable %}...{% else %}...{% endif %}
Renders the if-branch when the condition is true, the else-branch otherwise.
{% unless variable %}...{% endunless %}
Logical inverse of if — renders when the condition is false. Supports the same condition forms and an optional else branch.
Note: {% elsif %} and nested conditionals are not supported.
Basic Pango tags #
Pango markup can be edited directly in Code view mode. The inline toolbar creates these tags automatically.
| Syntax | Description |
|---|---|
|
Bold text |
|
Italic text |
|
Underlined text |
|
Strikethrough text |
|
Text color (hex value) |
|
Font weight (100–900) |
|
Font size as percentage (5%–200%) |
Advanced span attributes #
These attributes are not available via the toolbar but can be used in Code view.
| Syntax | Description |
|---|---|
|
Colored strikethrough line |
|
Background / highlight color |
|
Line height multiplier (e.g. 1.5 for 150%) |
Pro tip: Use your personal AI agent to create sophisticated template markup and styling.