generate_summary@v1.prompt
generateText({ prompt: 'generate_summary@v1', variables: { max_paragraphs: 2, company_data: '...' } }), Liquid replaces {{ max_paragraphs }} with 2 and {{ company_data }} with your content before the prompt is sent to the LLM.
Templates render before YAML parsing, so you can template the frontmatter too — useful for dynamic model selection or configuration.
Variables
The double-brace syntax{{ variableName }} renders values from the variables object you pass to the generate function.
Conditionals
Use{% if %} to include content only when a condition is true:
include_competitors: true, the competitor instruction is included. With false or undefined, it’s omitted entirely.
Add {% else %} for alternate content:
{% unless %} for the inverse — it renders when the condition is falsy:
Loops
Iterate over arrays with{% for %}:
forloop.index gives you the 1-based position (1, 2, 3…). Use forloop.index0 for 0-based indexing.
For arrays of objects:
Filters
Filters transform values using the pipe syntax{{ value | filter }}.
Text transformations:
tone is undefined or empty, it renders as “professional”.
Chaining filters: