Skip to content

Liquid Templating

Definer uses the Liquid template language in places where text needs to be built dynamically from your current lookup, source result, or other runtime data.

In the recipe editor, every mapping field can contain either plain text or a Liquid template. Lookup data shown in the left pane is the data your template can read from.

Recipe Editor Basics

Simplest Liquid expression inserts a value:

liquid
{{data.headword}}

That means:

  • data is the source result data from the current lookup
  • headword is one field inside that data
  • final rendered value replaces the {{ ... }} expression

You can mix normal text with dynamic values:

liquid
{{data.headword}} - {{data.srcLanguage}}

Where Data Comes From

When you edit a recipe, the left pane shows two things:

  • rendered source result
  • raw lookup data as JSON

That JSON structure is the easiest way to understand what values are available to your template. If you see a path like data.headword or lookup.meta.created in the left-side data, you can usually reference it in a field with Liquid syntax:

liquid
{{data.headword}}
{{lookup.meta.created}}

Common Examples

Save main term

liquid
{{data.headword}}

Save lookup timestamp

liquid
{{lookup.meta.created}}

Combine multiple values

liquid
{{data.headword}} ({{data.srcLanguage}})

Build tags dynamically

liquid
{{data.srcLanguage}}
dictionary

Filters

Liquid filters let you transform a value before it is saved.

liquid
{{data.headword | upcase}}
{{data.headword | downcase}}
{{data.headword | default: "Unknown"}}

Logic and Loops

For more advanced recipes, Liquid also supports conditions and loops:

liquid
{% if data.headword %}
{{data.headword}}
{% endif %}
liquid
{% for sense in data.senses %}
{{sense.gloss}}
{% endfor %}

Tips

  • Start simple. First make one field work with {{...}}, then add more logic only if you need it.
  • Use the left-side lookup data as your source of truth when deciding which path to reference.
  • If a field should stay constant, you can enter plain text without any Liquid syntax.
  • If you are unsure whether a value exists, use a default filter to provide a fallback.

Learn More