Templates

How templates work

Templates are plain HTML files in templates/. A handful of tags in double braces mark what can change, what repeats and what is shared, so you always know what Verso will do with them.

A template is an HTML file in templates/. Its name, without .html, is what a page names in its page.json. Styles are Elevate classes, written straight into class attributes. There is no build step of your own and no component syntax to learn.

What a template can hold

Everything Verso understands is written between double braces. Each kind has a page of its own.

KindLooks likeWhat it does
Fields{{ headline:text }}A place that holds content, editable on the page
Shared fields{{ site.phone:text }}A field that is the same on every page
Block areas{{ sections:blocks }}A place where editors stack blocks. With site. in front, like {{ site.header:blocks }}, the blocks are shared by every page
Repeaters{{ list:team }}…{{ /list }}A list of items, like a team, edited right on the page
Lists of pages{{ each:journal }}…{{ /each }}Repeats its contents for each page in a folder
Conditions{{ if:cover }}…{{ else }}…{{ /if }}Shows one part when something is filled in, another when it isn't
Counts{{ count:journal }}How many pages a list would show
References{{ page.title }}, {{ item.date:short }}Show a value without making it editable
Parts{{ part:header }}Brings in a file from parts/, so templates can share HTML

There are no variables and no expressions. A list can be filtered and sorted, and a condition can compare a value, but there is no arithmetic and no code. Every tag stays readable by anyone who knows HTML, and Verso can always tell which part of the page a value belongs to.

A complete template

<!DOCTYPE html>
<html lang="en">
{{ part:head }}
<body class="bg-color:paper text:ink">
  {{ part:header }}
  <main class="contain pd-y:d12 col gap:d6">
    <h1 class="font:h1:bold">{{ headline:text:required }}</h1>
    {{ if:cover }}<img src="{{ cover:image }}" class="w:full">{{ /if }}
    <div>{{ body:rich:headings:lists:links }}</div>
  </main>
  <footer class="pd-y:d8 font:small">{{ site.footer:text }}</footer>
</body>
</html>

A page template needs a <head>, written in the template or brought in by a part. Verso stops with a message if it doesn't have one, because the head is where it adds the title and stylesheet. Tags can't go inside <script> or <style>, and anything inside an HTML comment is left alone.

Pages are folders

A page is a folder in content/ with a page.json in it. The folder's path is the page's address: content/about/team/ is /about/team/, and content/page.json is the home page.

{
  "template": "post",
  "title": "Spring menu",
  "description": "What we're cooking this spring.",
  "date": "2026-04-02",
  "tags": ["Seasonal", "Menus"],
  "fields": {
    "headline": "Spring menu",
    "cover": { "file": "asparagus.jpg", "alt": "Asparagus on a board" }
  }
}

title, description, date and tags are the page's settings. A page can also be a "draft": true, which keeps it out of the live site and out of every list, and it can carry an "order", which the site view sets when you drag pages around. Text and image fields live under "fields". Each rich text field is its own file beside page.json, and images sit in the same folder, so a page moves as one piece. See Content files for every key.

What Verso adds to the head

  • A <title> from the page's title, followed by the site's name, like “About — Northlight”. If the title already has the site's name in it, it's used as it is, and a page with no title gets the site's name alone. Page 2 and later of a split list get “, page 2” after it. If your own <title> contains a reference, like {{ page.title }} · Northlight, Verso keeps yours instead.
  • A <meta name="description"> when the page has a description. One written in the template is replaced.
  • A link to the channel's RSS feed, on the pages of a channel, once the site has a "url". See Feeds and sub-folders.
  • A link to /elevate.css, unless the template already links it.

Scripts and the editing flag

Templates can load scripts like any HTML page. In the editor, Verso renders the same template and adds data-verso-editing to the <html> element. A script that rewrites the page can check for it and stay out of the way while fields are being edited:

if (!document.documentElement.hasAttribute('data-verso-editing')) {
  highlightCode();
}

The built site never has the flag. See JavaScript for more.