Formatting template variables
Waypoint uses LiquidJS to render the dynamic parts of a template (see template variables), so all the standard Liquid filters work out of the box.
A few of our favorites:
Default
Section titled “Default”Use | default to set a fallback when a value is missing — no need for a separate conditional. Example:
Data
{ "user": { "fullName": "" }}Input
Hi {{user.fullName | default: 'there'}}Output
Hi thereCapitalize
Section titled “Capitalize”Use | capitalize to uppercase the first character of a string. Example:
Data
{ "user": { "role": "admin" }}Input
{{user.role | capitalize}}Output
AdminTruncate
Section titled “Truncate”Use | truncate to shorten a string to a given character count. Example:
Data
{ "website": { "description": "Build and send emails, faster than ever." }}Input
{{ website.description | truncate: 25 }}Output
Build and send emails...Custom filters
Section titled “Custom filters”Waypoint adds a few custom filters on top of the standard LiquidJS set, available in any Waypoint template.
Currency
Section titled “Currency”Use | currency to format a number as currency. Defaults to USD. Example:
Input
{{ 40.5 | currency }}Output
$40.50Pass a currency code and locale to format for a specific region (defaults to ‘en-US’):
Input
{{ 10 | currency: 'EUR', 'fr-FR'}}Output
10,00 €Pluralize
Section titled “Pluralize”Use | pluralize to pick the singular or plural form of a word based on a number.
Data
{ "user": { "followersCount": 1 }}Input
{{user.followersCount}} {{ user.followersCount | pluralize: 'friend', 'friends' }}Output
1 friend