DraftThis article is currently in draft mode

Tera Reference

October 20, 2025

Table of Contents

Tera Reference#

Tera Documentation

  

Tera Documentation

#~2~# #~15~#

{{ tera_examples_as_shortcode() }}

Alice is 30 years old.

String Filters

lower: hello

capitalize: Hello world

title: Hello World

upper: HELLO WORLD

replace: Hello, Bob

linebreaksbr: Line one\nLine two

trim: "spaces"

truncate: hello wo…

split + join: path > to > file.txt

slugify: hello-world

Number Filters

round: 43

round(floor): 42

round(ceil): 43

Math: 15 (addition), 7 (subtraction), 20 (multiplication), 5 (division)

List Operations

join: red, green, blue

slice: one, two

concat: 1, 2, 3, 4

sort: 1, 2, 3

reverse: three, two, one

first: one

last: three

nth(1): two

length: 3

unique: 1, 2, 3

Control Flow

✓ Adult (age >= 18)

Loop example:

  • Index: 1, Item: one (first)
  • Index: 2, Item: two
  • Index: 3, Item: three (last)

Conditional Tests

value is defined - variable exists

fake_var is undefined - variable doesn't exist

age >= 18 - comparison operators work

name == "Alice" - equality test

age >= 18 and name == "Alice" - logical AND

not (age < 18 or age > 65) - logical OR with NOT

Advanced Patterns

Styled number list (conditional classes):

1 2 3 4 5

Page description: No description available

Chained filters: HELLO, TERA!

Page Context Examples

These examples work with data passed from Zola

page.title: Tera Reference

page.date: 2025-10-20

page.word_count: 21

config.title: Phosphor