Site Docs

# Theme reference

Everything a theme's templates are given and every rule a theme follows, in one place. For the developer writing a theme's code; site owners change colours and fonts in Site → Appearance instead.

Last updated: November 29, 2026

**Navigation**

This page is for web developers who write a site's theme code. A **theme** is a folder of templates and assets that **extends the base theme**: a theme holds only the files it changes, and every other file comes from the base theme. Owners and admins on Professional and up edit theme code under **Site → Theme code**, in the browser or by uploading a ZIP; the [colours, fonts and logo](https://www.teksaro.com/support/site/themes) stay in Site → Appearance whatever theme a site shows.

Templates are written in Jinja (the MiniJinja engine). They are given only what this page lists, so you never have to guess.

## The files of a theme

```
starter/
  _meta/theme.toml          required
  _meta/settings.toml       optional: what owners may change in Site → Appearance
  _meta/screenshot.png      optional: the picture on the theme's card in Site → Appearance
  _meta/README.md           optional: notes, licences (*.txt, *.md, LICENSE)
  layouts/default.jinja     only the files you change
  partials/navbar.jinja
  templates/page.jinja
  sections/
  assets/css/site.css
  assets/js/site.js
  assets/img/logo.svg
  assets/fonts/brand.woff2
```

The only **required file** is `_meta/theme.toml`. A theme with nothing else shows exactly the base theme. A ZIP may hold the theme at its top level or inside one folder (`starter/_meta/theme.toml`).

`_meta/theme.toml`:

```
name = "starter"          # the theme's name in your account: a-z, 0-9 and -
version = "1"             # yours to use; Teksaro numbers the versions it activates
title = "Northbridge"     # optional: its name on the card in Site → Appearance
author = "Kai Okafor"
description = "Northbridge's header and fonts."   # the line on its card
extends = "base"          # optional: a theme always extends the base theme
layouts = ["default", "wide"]   # optional: the layouts pages may choose
regions = ["header", "before_content", "after_content", "footer"]
teksaro = "1.1"

[layout_regions]          # optional: which regions each layout shows
default = ["header", "before_content", "after_content", "footer"]
```

Unknown keys are refused, so a typo is noticed. Leave out `layouts`, `regions` and `[layout_regions]` to keep the base theme's.

## Which file a page uses

Every file comes from the nearest theme that has it: your theme, then the base theme. To change a file, copy it from the base theme (**Copy a file from the base theme to change it** in the editor) and edit the copy. `{% include %}`, `{% extends %}` and `{% import %}` name files by their path in the theme, such as `{% include 'partials/navbar.jinja' %}`, and find only theme files: there is no way to reach a file outside the theme or the base theme.

### Page templates

| File | Renders |
| --- | --- |
| `templates/page.jinja` | A page |
| `templates/landing.jinja` | A page built from sections, often the home page |
| `templates/news-list.jinja` | The News list |
| `templates/news-item.jinja` | A news item |
| `templates/error.jinja` | An error page (not allowed, something went wrong) |
| `templates/404.jinja` | The "not found" page (it extends `error.jinja`) |
| `templates/coming-soon.jinja` | A site that isn't live yet |

Every other page (forms, bookings, the store, search, the help center, status pages) shows its own content inside the theme's `default` layout, in `page.body`.

### Layouts

A page chooses a layout in its Details. A layout is `layouts/<name>.jinja`, and every layout has a `content` block holding `page.body`.

| Layout | File | What it is |
| --- | --- | --- |
| `default` | `layouts/default.jinja` | Standard: the header, the title, the content in a card, the footer |
| `wide` | `layouts/wide.jinja` | Full width: the title, then the content across the page |
| `narrow` | `layouts/narrow.jinja` | Narrow: a narrow card under the title (also the sign-in forms) |
| `blank` | `layouts/blank.jinja` | No header or footer |

A theme may add its own (`layouts = ["default", "wide", "split"]` and `layouts/split.jinja`). Only layouts whose file exists are offered.

### Regions

Regions are where a site places sections once for every page, in [Site → Layout](https://www.teksaro.com/support/site/layout). A layout shows a region with one line: `{{ region('after_content') }}`.

| Region | Where the base theme puts it |
| --- | --- |
| `header` | After the top of the page |
| `before_content` | Before the content, after messages |
| `after_content` | After the content |
| `footer` | At the top of the footer |

The `blank` layout shows only `before_content` and `after_content`.

### The base theme's partials

| File | What it is |
| --- | --- |
| `partials/html-open.jinja` | `<!doctype html>`, `<html dir lang>` and the start of `<head>` |
| `partials/page-top.jinja` | The rest of `<head>` (with `frame.head` and `frame.style`) and the top of `<body>` |
| `partials/page-bottom.jinja` | The end of the page (with `frame.bottom`) |
| `partials/navbar.jinja` | The header: logo or name, the primary menu, search, languages, account |
| `partials/logo.jinja` | The logo, or the site's name |
| `partials/managed-menu.jinja` | A menu's entries (set `entries` with `{% with %}`) |
| `partials/footer.jinja` | The footer |
| `partials/page-links.jinja` | Macros: a page's breadcrumb, its languages and its subpages |

## What a template is given

The **view model**: the site, the page and the menus as a visitor sees them, and nothing else. A template never sees the person signed in, cookies, forms' security tokens, account data or another site. Text is escaped when it is shown; HTML from the site (`page.body`, regions, `frame` parts) is shown as it is.

### site

| Variable | Type | Example |
| --- | --- | --- |
| `site.name` | text | `Northbridge Consulting` |
| `site.long_name` | text | `Northbridge Consulting LLC` |
| `site.url` | text | `https://northbridge.example` |
| `site.logo` | object, or none | `{% if site.logo %}` |
| `site.logo.src` | text | `/media/logo.png` |
| `site.logo.beside` | yes/no | the name is shown beside the logo |
| `site.logo.width` | number, or none | `160` |
| `site.logo.height` | number, or none | `48` |
| `site.language` | text | `en` |
| `site.direction` | text | `ltr` or `rtl` |
| `site.languages` | list | the languages the site offers |
| `site.languages[].code` | text | `fr` |
| `site.languages[].url` | text | `/fr/about` (this page in that language) |
| `site.languages[].current` | yes/no | the page's own language |
| `site.address` | text | `50 State House Square, Hartford` |
| `site.time_zone` | text | `America/New_York` |

### page

| Variable | Type | Example |
| --- | --- | --- |
| `page.title` | text | `About us` (translated) |
| `page.meta.title` | text | the title for `<title>` |
| `page.meta.description` | text | the search description |
| `page.meta.keywords` | text | `consulting, pricing` |
| `page.body` | HTML | the page's content, shown as it is. On public content (pages, news, events, posts, collections, search, the shop...) for a visitor who isn't signed in, a template can read it; on anything else (a customer's account, an invoice, sign-in forms) and for a signed-in visitor it is a placeholder, filled in after the template renders: show it with `{{ page.body }}`, don't test or change it |
| `page.sections` | list of HTML | the page's sections, when it is built from them |
| `page.name` | text | a page's own title |
| `page.ancestors` | list | the breadcrumb above the page |
| `page.ancestors[].label` | text | `Services` |
| `page.ancestors[].href` | text | `/services` |
| `page.children` | list | the page's subpages |
| `page.children[].label` | text | `Pricing reviews` |
| `page.children[].href` | text | `/services/pricing` |
| `page.language_links` | yes/no | show links to the page's other languages |
| `page.title_shown` | yes/no | false when the page's first section has its own heading |
| `page.layout` | text | `default` (the layout the page is shown in) |
| `page.items` | list | News: the items on this page of the list |
| `page.items[].href` | text | `/news/pricing-mistakes` |
| `page.items[].title` | text | `Three pricing mistakes` |
| `page.items[].date` | text | `2026-11-29` |
| `page.items[].date_shown` | text | `Nov 29, 2026` (in the page's language) |
| `page.items[].excerpt` | text | the first lines |
| `page.items[].picture` | text, or none | `/media/news/cover.jpg` |
| `page.date` | text | a news item's date, `2026-11-29` |
| `page.date_shown` | text | `Nov 29, 2026` |
| `page.author` | text | `Sam Rivera` |
| `page.picture` | text | a news item's picture |
| `page.tags` | list of text | `["Pricing"]` |
| `page.status` | number | an error page's status, `404` |
| `page.message` | text | an error page's message |

### nav

Each menu the site has, by name: `nav.primary` (the main menu) and `nav.footer`. Test for one with `{% if 'primary' in nav %}`. Each is a list of entries, flat, in order; a branch opens a submenu and `close` ends it.

| Variable | Type | Example |
| --- | --- | --- |
| `nav.primary[].label` | text | `Services` |
| `nav.primary[].href` | text | `/services` |
| `nav.primary[].branch` | yes/no | this entry opens a submenu |
| `nav.primary[].close` | yes/no | this entry closes a submenu |
| `nav.primary[].current` | text | `page` on the page it links to, `true` on a page under it (News on a news item), else empty: write it as `aria-current` |

### business

The business details from Site → Business details. Read only when a template uses `business`.

| Variable | Type | Example |
| --- | --- | --- |
| `business.address_lines` | list of text | `["50 State House Square", "Hartford, CT 06103"]` |
| `business.phone` | text | `(860) 555-0110` |
| `business.email` | text | `hello@northbridge.example` |
| `business.map_url` | text | a map link |
| `business.hours` | list | opening hours |
| `business.hours[].day` | text | `Monday` |
| `business.hours[].hours` | text | `8:30 AM – 5:30 PM` |
| `business.hours_note` | text | `Closed on public holidays` |

### settings

The theme's settings, as the owner chose them in Site → Appearance. Read only when a template uses `settings`. A theme that has no `_meta/settings.toml` has the base theme's settings (Appearance's colours, fonts and logo), below; a theme with its own has the ones it declares (Settings), with colours under `settings.light` and `settings.dark` in the same way.

| Variable | Type | Example |
| --- | --- | --- |
| `settings.heading_font` | font key | `playfair-display`; `font_stack(settings.heading_font)` gives its CSS |
| `settings.body_font` | font key | `lato` |
| `settings.radius` | text | `medium` |
| `settings.page_width` | text | `standard` |
| `settings.logo_size` | text | `medium` |
| `settings.logo` | text | the logo's address, `/media/12/logo.png`, or `""` |
| `settings.logo_beside` | yes/no | the logo sits beside the site's name |
| `settings.favicon` | text | the favicon's picture, or `""` |
| `settings.dark_mode` | yes/no | the site offers a dark look |
| `settings.match_colours` | yes/no | the muted colours, cards and dark version follow the owner's colours |
| `settings.light` | colours by name | `settings.light.primary` is `#1d4ed8` |
| `settings.dark` | colours by name | `settings.dark.background` |

The colours' names: `primary`, `primary_text`, `background`, `text`, `muted_background`, `muted_text`, `border`, `card`, `heading`, `accent`, `link`.

### request

| Variable | Type | Example |
| --- | --- | --- |
| `request.path` | text | `/about` (no query string), on public content; on other pages the page's address when it has no parts of its own (`/account`), else empty (an invoice's link never reaches a theme) |
| `request.language` | text | `en` |
| `request.year` | number | `2026` |

### news

The site's 10 latest published news items, for a home page or a footer. Read only when a template uses `news`.

| Variable | Type | Example |
| --- | --- | --- |
| `news[].href` | text | `/news/pricing-mistakes` |
| `news[].title` | text | `Three pricing mistakes` |
| `news[].date` | text | `2026-11-29` |
| `news[].date_shown` | text | `Nov 29, 2026` |
| `news[].excerpt` | text | the first lines |
| `news[].picture` | text, or none | `/media/news/cover.jpg` |

### regions

`regions` holds each region's HTML by name, for the regions the page's layout shows: `{{ regions.footer }}` is the same as `{{ region('footer') }}`. A region with live sections filled for the visitor (a downloads list, a signup form, the latest news) is a placeholder, filled in after the template renders: show it, don't test or change it.

### frame

Parts of the page Teksaro fills in after your template renders, because they hold things a theme must not see (a form's security token, the person signed in). Place each once, where it belongs; leave one out and the page loses it.

| Part | What it holds | Where the base theme puts it |
| --- | --- | --- |
| `frame.head` | Sharing and search tags, the site's styles, the cookie banner, analytics, feeds | In `<head>` |
| `frame.style` | The Appearance colours, icons and the site's own head code | In `<head>`, after `frame.head` |
| `frame.top` | The "not live" bar and the site's notices | At the top of `<body>` |
| `frame.flash` | Messages after a form is sent | Before the content |
| `frame.bottom` | Scripts, analytics and the site's footer code | Before `</body>` |
| `frame.search` | The search box | In the header |
| `frame.languages` | The language switcher | In the header |
| `frame.languages_footer` | The language switcher for the footer | In the footer |
| `frame.account` | The customer account link | In the header |
| `frame.comments` | Comments and the comment form | After a news item |
| `frame.pagination` | Previous and next pages of a list | After the News list |
| `frame.form` | The preview password form of a site that isn't live | In `coming-soon.jinja` |
| `frame.members` | The members' way in, while the site isn't live | In `coming-soon.jinja` |

An empty part is `""`, so `{% if frame.search %}` works.

## Helpers

| Helper | Gives | Example |
| --- | --- | --- |
| `t(key)` | Teksaro's text for `key` in the page's language | `{{ t('siteMainNav') }}` |
| `url(link)` | the link when it is safe (`/path`, `https://`, `http://`, `mailto:`, `tel:`, `#...`), else `#` | `<a href="{{ url(entry.href) }}">` |
| `asset(path)` | the address of a file under the theme's `assets/` | `{{ asset('css/site.css') }}` |
| `date(value, style)` | a date in the site's time zone and the page's language; `style` is `long`, `medium` (the default) or `short` | `{{ date(page.date, 'long') }}` |
| `image(src, width)` | a site picture at the nearest prepared width | `{{ image(page.picture, 640) }}` |
| `region(name)` | the sections placed in region `name`, when the page's layout shows it; nothing otherwise | `{{ region('footer') }}` |
| `font_stack(key)` | the CSS `font-family` of a font setting's value: the theme's own font, or one Teksaro serves (`inherit` for neither); safe in a `<style>` element and in a `style="..."` attribute | `font-family: {{ font_stack(settings.headline_font) }}` |
| `font_faces(key)` | the `@font-face` rules of a font setting's value, the theme's own font or one Teksaro serves, for a `<style>` element | `<style>{{ font_faces(settings.headline_font) }}</style>` |

Jinja's own functions also work: `range`, `dict`, `namespace` and `debug` (which shows everything the template is given, handy while you work).

## Filters and tests

Teksaro's own:

- `css_string`, a text as a quoted CSS string with everything but letters, digits and spaces escaped, for putting a setting's text in CSS: `content: {{ settings.motto|css_string }}`. Without it, text in a `<style>` element would be escaped for HTML, which CSS doesn't read.
- `mix(other, percent)`, a colour (`#rrggbb`) with `percent` of another mixed in, as `#rrggbb`: a hairline from the paper and the ink, `{{ settings.light.paper|mix(settings.light.ink, 12) }}`.
- `text_on(first, second)`, of two colours the one that reads better on this one, as `#rrggbb`: the words on a button in your brand colour, `{{ settings.light.brand|text_on(settings.light.paper, settings.light.ink) }}`.
- `oklch`, a colour as the three numbers the site's stylesheet keeps its colours in (`54.6% 0.215 262.9`). Buttons, forms and sections take their colours from these variables, so a theme with colours of its own sets them: `:root[data-theme=tenant]{--p:{{ settings.light.ink|oklch }}}` (`--p` buttons, `--pc` text on them, `--a` accent, `--b1` background, `--b2` muted background, `--b3` borders, `--bc` text; `tenant-dark` for the dark version). Editorial's `partials/palette.jinja` is an example.

The usual Jinja filters: `abs`, `attr`, `batch`, `bool`, `capitalize`, `count`, `default` (`d`), `dictsort`, `escape` (`e`), `first`, `float`, `groupby`, `indent`, `int`, `items`, `join`, `last`, `length`, `lines`, `list`, `lower`, `map`, `max`, `min`, `reject`, `rejectattr`, `replace`, `reverse`, `round`, `safe`, `select`, `selectattr`, `slice`, `sort`, `split`, `string`, `sum`, `title`, `trim`, `unique`, `upper`.

The usual tests: `defined`, `undefined`, `none`, `true`, `false`, `even`, `odd`, `number`, `string`, `sequence`, `mapping`, `startingwith`, `endingwith`, `in`.

Output is escaped. `safe` shows text as HTML: use it only for HTML you wrote, never for the site's text.

## Settings

`_meta/settings.toml` says what an owner may change in **Site → Appearance**, where the theme's settings form is built from it. Each site keeps its own values for each theme, so switching themes and back restores them. Every value is checked by its type when it is saved and again when a page is shown; one that no longer fits (a font the theme dropped, say) shows its default.

```
[[font]]                       # a font the theme brings, files under assets/fonts/
key = "newsreader"
name = "Newsreader"
stack = "'Newsreader', Georgia, serif"
files = [{ file = "assets/fonts/newsreader.woff2", weight = "200 800" },
         { file = "assets/fonts/newsreader-italic.woff2", weight = "200 800", style = "italic" }]

[[group]]                      # a card on the form
key = "colours"
label = { en = "Colours", fr = "Couleurs", de = "Farben" }

[[group.setting]]
key = "ink"                    # settings.light.ink and settings.dark.ink
type = "colour"
label = { en = "Ink", fr = "Encre" }
default_light = "#1b1f3b"
default_dark = "#e8e9f3"

[[group.setting]]
key = "headline_font"          # settings.headline_font
type = "font"
label = "Headlines"
fonts = ["newsreader", "playfair-display", "lora"]
default = "newsreader"

[[group.setting]]
key = "issue_home"
type = "toggle"
label = "Show the home page as an issue"
default = true

[[group.setting]]
key = "header"
type = "choice"
label = "Header"
default = "centred"
options = [{ value = "centred", label = "Centred" }, { value = "start", label = "At the start" }]

[[group.setting]]
key = "cover"                  # settings.cover: "/media/..." or ""
type = "image"
label = "Cover picture"

[[group.setting]]
key = "tagline"
type = "text"
label = "Tagline"
max = 80
default = "Notes from the bakery"
```

| Type | The owner chooses | A template gets |
| --- | --- | --- |
| `colour` | a light and a dark colour | `#rrggbb` in `settings.light.<key>` and `settings.dark.<key>` |
| `font` | one of `fonts` (Teksaro's keys or the theme's `[[font]]`s; every font Teksaro serves when `fonts` is left out) | its key; `font_stack()` and `font_faces()` give its CSS |
| `toggle` | on or off | yes/no |
| `choice` | one of `options` | the option's `value` |
| `image` | a published picture of the site's own media library (choosing it doesn't publish it) | its address, or `""` when none is chosen or it is no longer published |
| `text` | one line, at most `max` characters (200 if left out, 500 at most) | the text, escaped as everywhere |

- Keys are `a-z`, `0-9` and `_`, starting with a letter; not `light` or `dark`, nor the form's own `csrf_token`, `edit_version`, `bound_theme` or `theme`. Option values and font keys are `a-z`, `0-9` and `-`.
- A label is one text, or a text per language code (`en`, `fr`, `es`, `de`, `zh-CN`, `zh-TW`): the reader's language shows, else English. A `note` (or `note_key`) adds a line under a setting or behind a group's "?". The base theme uses Teksaro's own strings with `label_key`.
- A font's `stack` holds letters, digits, spaces, commas, `-` and `'`. Its files must be in the theme (or a theme it extends), with their licence in `_meta/`.
- At most 20 groups, 100 settings, 50 options and 20 fonts. Unknown keys are refused, so a typo is noticed; a problem names `_meta/settings.toml` and its line, and the theme isn't activated until it is fixed.
- A theme without `settings.toml` has its parent's: the base theme's, for most themes, so Appearance's colours and fonts keep working.

## Assets

Files under `assets/` are served at a versioned address, cached for a year, and only on the sites of the account that owns the theme. Link them with `asset()`; inside a CSS file, use addresses relative to the file (`url("../fonts/brand.woff2")`).

| Folder | Files | Largest file |
| --- | --- | --- |
| `assets/css/` | `.css` | 256 KiB |
| `assets/js/` | `.js` | 256 KiB |
| `assets/img/` | `.png`, `.jpg`, `.jpeg`, `.webp`, `.avif`, `.gif`, `.svg` | 4 MiB (SVG 256 KiB) |
| `assets/fonts/` | `.woff2`, `.woff`, `.ttf`, `.otf` | 4 MiB |
| `layouts/`, `partials/`, `sections/`, `templates/` | `.jinja` | 256 KiB |
| `_meta/` | `theme.toml`, `settings.toml`, `screenshot.png`, `LICENSE`, `README`, `*.txt`, `*.md` | 256 KiB (`screenshot.png` 4 MiB) |

- A file must be what its name says: a `.png` must be a PNG. Text files are UTF-8.
- An SVG is served as a picture that runs no script; put it in an `<img>`, not inline.
- No archives inside a theme, no links (symlinks), no hidden files, no `..`, no two entries of one name in a ZIP. Two names that differ only by capitals are refused, folders too (`Logos/` and `logos/`), and so is a file named as a folder. Names use letters, digits, `-`, `_` and `.`, at most six folders deep.
- A file left in a folder it doesn't belong in, or of another type, is refused with its name.

## Limits

| Limit | Value |
| --- | --- |
| Files in a theme | 600 |
| A theme's files together | 32 MiB |
| A ZIP upload | 40 MiB, 1,200 entries |
| An image, font or other single file upload | 4 MiB |
| An account's themes | 20, and 512 MiB together (drafts and earlier versions included) |
| A page's work | 2,000,000 template steps |
| Includes, macros and layouts inside one another | 64 deep |
| A rendered page | 4 MiB |
| A page's time to render | 2 seconds |

A page that goes over a limit isn't shown broken: visitors get a plain page with the content, and the theme's error is logged for us.

## Right to left

For Arabic, Hebrew, Persian, Urdu and the other right-to-left languages, `site.direction` is `rtl` and the base theme puts `dir="{{ site.direction }}"` on `<html>`. Write every file so the page mirrors by itself:

- Classes by start and end, never left and right: `ms-` and `me-` (not `ml-` and `mr-`), `ps-` and `pe-`, `start-` and `end-`, `text-start` and `text-end`, `rounded-s`, `border-s`, `float-start`.
- CSS by logical properties: `margin-inline-start`, `padding-inline-end`, `inset-inline-start`, `text-align: start`.
- Icons that point a way (a "next" arrow, a chevron) flip: add `rtl:rotate-180`. Icons that don't point stay.
- Keep the `dir` attribute if you replace `partials/html-open.jinja`.

## Checks and errors

Saving keeps a **draft**: the live site doesn't change. The editor checks the draft, and **Activate** checks it again before it goes live:

- every template compiles;
- your templates use only the names on this page (or names another of your templates sets, such as a loop's variable or `{% with %}`): a misspelt `site.nmae` would show nothing, so it is refused;
- each layout and page template renders with sample content within the limits.

A problem names its file and line, such as `partials/navbar.jinja, line 12: unexpected end of block`. Nothing goes live until every problem is fixed. After activating, **Roll back** returns the site to the version it showed before.

## A starter theme

The smallest useful theme: the base theme with its own stylesheet, a font and a button in the header. Make these files, ZIP the folder and upload it under Site → Theme code.

`_meta/theme.toml`:

```
name = "starter"
version = "1"
author = "Your name"
description = "The base theme with its own header, stylesheet and font."
extends = "base"
teksaro = "1.1"
```

`partials/page-top.jinja`: copy the base theme's file and add the stylesheet after `{{ frame.style }}`:

```
  {{ frame.style }}
  <link rel="stylesheet" href="{{ asset('css/site.css') }}">
```

`partials/navbar.jinja`: copy the base theme's file and add the button after `{{ frame.account }}`:

```
  <a class="starter-book" href="{{ url('/forms/contact') }}">Book a call</a>
```

`assets/css/site.css`, with the font in `assets/fonts/brand.woff2` (and its licence in `_meta/`):

```
@font-face {
  font-family: "Brand";
  src: url("../fonts/brand.woff2") format("woff2");
  font-display: swap;
}

body.tenant { font-family: "Brand", system-ui, sans-serif; }
.starter-book { margin-inline-start: 0.5rem; padding-inline: 0.9rem; }
```
