Hypertekt › Docs › Reference

The template language

Everything a site's files can say: templates, collections, forms, site.yaml, redirects and scripts, with how pages are served and what the checker finds.

Hypertekt pages are HTML with a small template language on top. It looks like Mustache and Handlebars, so it’s familiar, but it’s stricter than either:

  • Small and fully specified. Everything it can do is on this page.
  • Checked before it runs. Templates, partials and collections all have types, so a typo in a field name, a missing prop or a pipe given the wrong kind of value is an error in the editor, not a blank spot on the live site.
  • No code in templates. There are paths, pipes and a few blocks, and nothing else. Anything that needs real logic goes in a server function, which fills a collection the template reads.
  • Safe by default. Every value is escaped for where it’s written. Text can’t turn into HTML by accident.
  • Deterministic. The same files and data always build the same site. There’s no random, and the only clock is the time of the build. The one thing that changes from visit to visit is a sample, which is picked as each page is served (see Different on every visit).
  • Analyzable. The engine can tell exactly which collections and fields every page reads, so a change to one collection only rebuilds the pages that use it.

A site’s files

site.yaml                 name, base URL, language, time zone, default layout
redirects.yaml            old URLs and short links (see "Redirects")
pages/                    every file here is a page; its path is its URL
  index.html              → /
  about.html              → /about
  menu/index.html         → /menu
  menu/[slug].html        → /menu/<item's slug>, one page per item (see "One page per item")
  menu/_defaults.yaml     front matter for every page in menu/ (see "Defaults for a folder")
  feed.xml                → /feed.xml
  404.html                → shown, with a 404, for URLs that don't exist (see "Serving")
  projects/fcp/fcp.css    → /projects/fcp/fcp.css, copied as it is
layouts/                  layouts pages are rendered inside
  base.html
partials/                 components, used with {{> name}}
  card.html
  menu/item.html          → {{> menu/item}}
collections/              one schema per collection
  menu.yaml
content/                  one file per item, named for its id (see "Where items are kept")
  menu/soup-of-the-day.yaml
  posts/onyomi-or-kunyomi.md
forms/                    one file per form visitors can send (see "Forms")
  contact.yaml
functions/                server functions (see "Server functions", their own spec)
assets/                   copied as they are: CSS, images, fonts, scripts (but nothing starting with a dot)
snippets/                 HTML pasted from elsewhere, added to pages (see "Scripts and analytics")
public/                   served at exactly these paths, as they are (see "Files at exact paths")
  favicon.ico             → /favicon.ico
  .well-known/matrix/server
skeletons/                what a new file starts as, in the dashboard, by folder; never built (see "Skeletons")
  pages/programs.html     → a new page in pages/programs/, and a new program in the Content tab

Skeletons

A new file made in the dashboard starts as a skeleton: a starting point for a file in that folder. That goes for a new file in the Code tab, and for a new page of a collection of pages in the Content tab (New, for a collection whose pages: has one *).

A site keeps its own skeletons in skeletons/. Each skeleton is named for the folder it’s for, with the new file’s extension: skeletons/pages/programs.html is what a new page in pages/programs/ starts as. The nearest skeleton is used, so skeletons/pages.html is for every page without a nearer one, and skeletons/collections.yaml is for a new schema. A page’s skeleton can write the page’s fields, like <p>{{ page.summary }}</p>, so what an owner fills in shows on the page. The values in the skeleton’s front matter are filled into the new page’s form, like the words on a button. Nothing in skeletons/ is built.

When the site has no skeleton for a new file, the file starts as the platform’s skeleton for its kind (a schema with one field, a form, a page with its title, a layout with its slots, a .gitignore that leaves out what tekt builds and .env). A new page in the Content tab then starts as a copy of the collection’s first page, with its fields left empty and the rest of its front matter, like its layout, kept.

URLs have no slash at the end: about.html is /about, and menu/index.html is /menu. A URL with a slash at the end redirects to the URL without the slash (a 301), so either works for visitors and only one counts for search engines.

Files in pages/ ending in .html, .xml, .txt, .json or .webmanifest are templates. feed.xml and robots.txt keep their names. Any other file in pages/, like a stylesheet or a font next to the page that uses it, is copied as it is, at its path. Since a page’s URL has no slash at the end, relative links in templates (href="./fcp.css" in pages/projects/fcp/index.html) are made absolute (/projects/fcp/fcp.css) when the site is built, so each link points where it appears to. The same goes for layouts and partials: a relative link is resolved from the folder of the page being built. A file or folder whose name starts with _ is ignored, so it can hold notes or work in progress (_defaults.yaml is the one exception).

sitemap.xml and robots.txt are made for every site, unless pages/ or public/ has its own. See Page metadata and search.

Front matter

A page, layout or partial can start with YAML between --- lines. It has to be the very first thing in the file:

---
title: Our menu
description: Seasonal small plates and natural wine, made in Portland.
layout: base
---
<h1>{{ page.title }}</h1>
Key Where What it does
title pages The page’s title, for search results, shared links and the browser tab.
description pages A sentence or two about the page, for search results and shared links.
image pages The image shown when the page is shared. Made for you if there isn’t one.
type pages What the page is, for shared links: website (the default), article, or any OpenGraph type, like product, game or profile.
favicon pages, _defaults The page’s icon in the browser tab, from assets/, when it isn’t the site’s.
app pages A mobile app the page is about, for app share cards. See Page metadata and search.
noindex pages true to keep the page out of search engines and the sitemap.
shareTitle pages A different title for shared links, when it should differ from title.
shareDescription pages A different description for shared links.
canonical pages The URL of the original, for a page that’s a copy of one published elsewhere.
structuredData pages Hand-written schema.org JSON-LD. See Structured data.
layout pages and layouts The layout to render inside. layout: none for no layout.
each pages Render one page per item of a collection. See One page per item.
props partials The props the partial takes, with their types. See Partials.
styles, scripts partials The partial’s own stylesheets and scripts in assets/, written into the head of every page that uses the partial. See Partials.
page layouts The front matter the layout reads from the pages inside it, with types. See Layouts.
anything else pages Your own values. Every front matter value is read as page.<key>.

title through structuredData are the page’s metadata. The engine writes the tags for them into every page’s <head> itself. See Page metadata and search. These keys have types, and a value of the wrong type is an error (front-matter-type): title, description, type, shareTitle and shareDescription are text, noindex is yes or no, canonical is a URL, image is a path in assets/ or { path, alt }, and app has only name, category, iphone, ipad and googleplay.

A key of your own that’s a likely typo of one of these, like descripton, does nothing, and the checker says so (a warning). Pages that hold data, like a list of projects, are best made a collection of pages (see Collections of pages), so their own keys are checked too.

Defaults for a folder

A _defaults.yaml in a folder of pages/ holds front matter for every page in that folder and the folders inside it. A page’s own front matter wins, and a deeper folder’s defaults win over a shallower one’s. That’s how one part of a site gets a look of its own. For example, pages/projects/duck-tabata/_defaults.yaml:

layout: duck-tabata
titleFormat: "{{ page.title }} · Duck Tabata"
favicon: duck-tabata/favicon.ico
image: duck-tabata/link_cover.png

_defaults.yaml can also set titleFormat, which otherwise comes from site.yaml.

Output

{{ path }} writes a value, escaped for where it is:

<h2>{{ item.name }}</h2>
<a href="{{ item | url }}" title="{{ item.name }}">More</a>
  • In text, <, > and & are escaped. In an attribute, quotes are escaped too.
  • In href, src and other URL attributes, a value at the start of the attribute has to be a safe link: a path, or one starting with http:, https:, mailto:, tel: or sms:. Anything else, like javascript: or data:, is replaced with #, with a warning (unsafe-url). A value after the start of the attribute (href="tel:{{ phone }}") is only escaped.
  • Inside <script> and <style>, and in on… attributes like onclick, a value can only be written with the json pipe ({{ hours | json }}). Anything else there is an error (script-output).
  • Between a tag’s attributes (<div {{ x }}>) nothing can be written (output-in-tag).
  • A value that’s already HTML (rich text, the output of markdown) is written as it is, without escaping. HTML is its own type, and it never comes from plain text by accident. See Types.

A value that’s empty (null, missing or an empty string) writes nothing. To show something in its place, use default: {{ item.subtitle | default "Fresh today" }}.

Other values are written like this: a number as it is (2.5; use number or money to format it), yes or no as true or false, a date as 2026-12-24 or 2026-11-21T18:30:00Z (use date to format it), and an image as its URL. A list or an item can’t be written as it is: that’s a warning (unwritable-value), and nothing is written.

{{! a comment }} writes nothing. Comments can span lines. A comment that needs }} inside it is written {{!-- like this --}}.

To write {{ itself, put a backslash before it: \{{ count }} writes {{ count }}. For a longer stretch, like pasted code that uses {{ itself, put the code between {{#verbatim}} and {{/verbatim}}: everything between them is written as it is, tags and all.

<script type="text/x-template">
{{#verbatim}}
<p>{{ message }}</p>
{{/verbatim}}
</script>

There’s no {{{ }}}. Writing one is an error (triple-braces) that explains what to do instead: a value that’s HTML already comes out as HTML with {{ }}, and plain text is only trusted as HTML with {{ x | raw }}.

Paths

A path is a name followed by fields: item.name, item.chef.name, site.name.

These names are always there:

Name What it is
site Values from site.yaml: site.name, site.url, site.language, and anything else in it.
page The page being rendered: its front matter, plus page.url, its URL on the site (/menu), and page.path, its file in pages/ (menu/index.html).
build build.time, the time the site was built. It’s the only clock there is.
props In a partial, the props it was given.
pages Every page on the site, with its url, path, title, description, image and front matter, for menus and lists of pages. A page made per item is there once per item.
collection Every collection that isn’t private, by its name: menu is the list of all its items.

The other names are the ones blocks bring in ({{#each menu as item}} brings in item). A block’s name can’t be the same as a collection’s or another name in scope. That’s an error, so a name always means one thing.

A field that’s a reference to another collection (item.chef) is the item it points to, so item.chef.name works without a lookup.

A value in parentheses can have fields after it, like a path: (posts | find "slug" page.next).title. When nothing is found, the value is empty, like any missing field.

Two items are the same when they’re the same item, so where "artist" artist finds an artist’s albums, and eq compares items as you’d expect.

Bare words are always names. Strings are always in double quotes: "Starters". Numbers are written as they are: 5, 2.5, -1. true, false and null are what they look like.

Names are letters, digits and _, starting with a letter or _. A few words belong to the language, so they can’t start a path: and, or, not, as, true, false, null, else and slot. After a dot they’re ordinary field names (item.not is fine).

Pipes

A pipe takes the value on its left and gives back a new one. Pipes chain from left to right:

{{ item.name | upper }}
{{ item.price | money "USD" }}
{{ post.date | date "MMMM d, yyyy" }}
{{ post.body | markdown }}
{{ post.summary | default post.body | truncate 160 }}

A pipe’s arguments come after its name, separated by spaces. Some also take named arguments (resize width=800). Every pipe has a signature: what it takes, what arguments it needs and what it gives back. The checker uses these to check every use. The pipes are listed in “Standard pipes”.

Blocks

Blocks start with {{#name ...}} and end with {{/name}}. Any line that holds only a block tag ({{#…}}, {{/…}}, {{else}}) or a comment, and spaces, is removed from the output, so blocks don’t leave blank lines behind. That’s the only whitespace rule: there’s no {{~ ~}} for trimming by hand.

if

{{#if item.soldOut}}
  <span class="badge">Sold out</span>
{{else if item.price | lt 5}}
  <span class="badge">Under $5</span>
{{else}}
  <span class="price">{{ item.price | money "USD" }}</span>
{{/if}}

A condition is a value, read as yes or no. false, null, a missing value, 0, "" and an empty list are no; anything else is yes. Conditions can use not, and, or and parentheses:

{{#if item.vegan and not item.soldOut}} ... {{/if}}
{{#if (item.tags | includes "spicy") or item.hot}} ... {{/if}}

Comparisons are pipes, so they read the same way as everything else: eq, ne, lt, lte, gt, gte, includes.

each

<ul>
  {{#each menu | where "category" "Starters" | sort "name" as item}}
    <li>{{ item.name }} {{#if @last}}(last one!){{/if}}</li>
  {{else}}
    <li>Nothing here yet.</li>
  {{/each}}
</ul>

each goes through a list, naming each item with as. The name is required. There’s no this and no implied context, so it’s always clear where a value comes from. The {{else}} part is shown when the list is empty.

Inside the block, @index (from 0), @number (from 1), @first, @last and @count describe the innermost each.

Collection queries

The list pipes make each a query. They’re the same pipes used anywhere else:

{{#each posts | where "published" | sort "-date" | limit 5 as post}} ... {{/each}}

{{#each menu | group "category" as group}}
  <h2>{{ group.key }}</h2>
  {{#each group.items as item}} ... {{/each}}
{{/each}}

{{ menu | where "vegan" | count }} vegan dishes

Field names in query pipes are strings, and the checker checks them against the collection’s schema. The checker also says when a comparison can never be true, like where "price" "cheap" on a number field.

Lists of pages

pages is every page, with its front matter, so a menu can come from the pages themselves. Give the pages that belong in the menu a front matter key of their own, and query pages like a collection:

{{#each pages | where "menu" | sort "menuOrder" as item}}
  <a href="{{ item.url }}"{{#if page.url | eq item.url}} class="current"{{/if}}>{{ item.title }}</a>
{{/each}}

For pages that hold data of their own, like a list of projects with their release dates and icons, make them a collection of pages instead (see Collections of pages): their front matter is checked, and templates read them as that collection.

Different on every visit

sample picks some items at random, fresh for every visitor. Three reviews, a different three each time:

<section class="reviews">
  {{#each reviews | sort "-created" | limit 30 | sample 3 as review}}
    <blockquote>
      <p>{{ review.quote }}</p>
      <footer>{{ review.name }}</footer>
    </blockquote>
  {{/each}}
</section>
  • The build still writes the same page every time. It writes every item that could be picked, marked as a group, and the edge picks n of them as it serves the page, leaving the rest out. Visitors don’t need JavaScript, and nothing jumps around as the page loads.
  • At most 50 items go into the page. Put limit before sample to choose which, as sort "-created" | limit 30 does above, picking from the newest 30.
  • The picked items stay in the order the list was in. Sort before sample to choose that order.
  • sample only goes at the end of an each’s list, since nothing else can know which items will be picked. The body of the each has to be one element, like the <blockquote> above, so the edge can take the unpicked items out whole. The body can’t use @index, @first or the other @ values, which would count items that aren’t shown. The checker says when any of these rules is broken.
  • In the editor’s preview, the same items are picked every time, so the page doesn’t change between looks. The preview has a button to pick again.

Partials

A partial is a component in partials/. It declares the props it takes in its front matter. partials/card.html:

---
props:
  title: text
  image: image?
  href: url?
---
<article class="card">
  {{#if props.image}}<img src="{{ props.image | resize width=600 }}" alt="{{ props.image.alt }}" />{{/if}}
  <h3>{{#if props.href}}<a href="{{ props.href }}">{{ props.title }}</a>{{else}}{{ props.title }}{{/if}}</h3>
  {{ slot }}
  {{ slot "footer" }}
</article>

Use a partial with {{> name}}, giving props as name=value:

{{> card title=item.name image=item.photo href=(item | url)}}

Or as a block, to fill its slots:

{{#> card title="Catering"}}
  <p>We cater events of up to 200 people.</p>
  {{#fill "footer"}}<a href="/contact">Ask us</a>{{/fill}}
{{/card}}
  • {{ slot }} writes what the block held. {{ slot "footer" }} writes what a {{#fill "footer"}} held. An unfilled slot writes nothing, or its own content if it’s written as a block: {{#slot "footer"}}default{{/slot}}.
  • A prop’s type is written as in “Types”, like text, image?, item<menu> or list<item<menu>>, and ends in ? if it’s optional. A required prop that’s missing, a prop the partial doesn’t declare and a value of the wrong type are all errors. An image prop can be given a path in assets/ as it is, like an image in front matter: {{> ht/picture image="banners/gym.jpg" alt="The gym floor"}}. A path to an image that isn’t there is a warning (missing-asset).
  • A partial only sees its props, site, page, build and the collections. It doesn’t see the names from blocks around it: pass them in as props. That keeps partials easy to reuse, and easy to check on their own.
  • Partials can use other partials. A partial that uses itself, directly or not, is an error.
  • A partial can bring its own stylesheets and scripts, files in assets/, with styles and scripts in its front matter: styles: [card.css], scripts: [carousel.js]. Every page that uses the partial, directly or through its layouts and other partials, gets each file once, however many times the partial is used, in the order the files are first used. The files go at the start of the <head>, after the engine’s own tags and before the layout’s, so the site’s own styles win. Scripts are deferred, and a .mjs file is a module. A partial that’s only used inside an {{#if}} whose condition is no brings nothing.

Layouts

A layout is a partial in layouts/ that a page is rendered inside. The page fills the layout’s {{ slot }}, and can fill named slots with {{#fill}}. layouts/base.html:

<!doctype html>
<html lang="{{ site.language }}">
  <head>
    <link rel="stylesheet" href="{{ "site.css" | asset }}" />
    {{ slot "head" }}
  </head>
  <body>
    {{> header}}
    <main>{{ slot }}</main>
    {{> footer}}
  </body>
</html>

pages/about.html:

---
title: About us
description: Two sisters, one wood oven, and ten years of Friday pizza nights.
---
{{#fill "head"}}<link rel="stylesheet" href="{{ "about.css" | asset }}" />{{/fill}}
<h1>About us</h1>

The layout doesn’t write <title> or any meta tags: the engine adds them to the <head> of every page, from the page’s metadata. See Page metadata and search.

A layout can name a layout of its own, to nest them. The layout in site.yaml is used when a page doesn’t name one.

A page doesn’t pass props to its layout: it gives the layout its front matter, read as page, and its fills. A layout lists the front matter it reads under page, with types, the way a partial lists its props. layouts/article.html:

---
layout: base
page:
  published: date
  author: text?
  cover: image?
---
<article>
  {{#if page.cover}}<img src="{{ page.cover | resize width=1200 }}" alt="{{ page.cover.alt }}" />{{/if}}
  <h1>{{ page.title }}</h1>
  <p>{{ page.published | date "MMMM do, yyyy" }}{{#if page.author}} · {{ page.author }}{{/if}}</p>
  {{ slot }}
</article>
  • In the layout, page has title, description, image, url and path, and the keys the layout lists. Reading any other key is an error (unknown-field), and the error says to list the key.
  • Every page rendered inside the layout has to have the keys the layout lists, from the page’s own front matter or a folder’s _defaults.yaml: a missing key is an error (missing-front-matter), and so is a value of the wrong type (front-matter-type). A key that looks like a typo of a listed key, like publshed, is pointed out.
  • An image in front matter is written as its path in assets/ (cover: blog/oven.jpg), and the layout gets it as an image.
  • A page inside nested layouts needs the keys that each layout lists.

A partial sees whichever page is being rendered, so in a partial, page has every key that any page’s front matter has, each of which may be empty.

One page per item

A page whose path has a [field] in it renders once per item of the collection named by each. pages/menu/[slug].html:

---
layout: base
each: menu | where "category" ne="Drinks" as item
title: "{{ item.name }}"
description: "{{ item.summary }}"
image: "{{ item.photo }}"
---
<h1>{{ item.name }}</h1>
{{ item.description }}
  • The [field] is filled from that field of each item: a slug field, or the item’s id. Every page needs a URL of its own, so two items that would make the same URL are an error (url-clash).
  • A path can have more than one [field], and a field can reach through references: pages/listening/[artist.slug]/[slug].html makes /listening/radiohead/ok-computer. The fields together have to be unique, so two artists can each have an album called “Greatest Hits”.
  • To make a page for each value of a field rather than each item, like one page per tag, use the values pipe: each: posts | values "tags" as tag with pages/blog/tagged/[tag].html. A bracket named after the each name itself is filled from the value, made into a slug: /blog/tagged/japanese-food.
  • The query works like the query of an each block, so a page can leave items out.
  • Front matter values can use the item, as title does here. A value that’s a single {{ }} and nothing else keeps that value’s type, so image here is the photo itself, not its URL as text.
  • {{ item | url }} anywhere on the site gives the URL of the page that renders that item. If no page renders it, the checker says so. A link written this way never breaks when a page moves.
  • When an item’s slug changes, its old URL redirects to the new one. See Moved pages.

Every page is ready for search engines and for being shared, without the layout doing anything. The engine writes these into the <head> of every HTML page:

<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Our menu · Luna's Kitchen</title>
<meta name="description" content="Seasonal small plates and natural wine, made in Portland." />
<link rel="canonical" href="https://lunaskitchen.com/menu" />
<meta property="og:title" content="Our menu" />
<meta property="og:description" content="Seasonal small plates and natural wine, made in Portland." />
<meta property="og:url" content="https://lunaskitchen.com/menu" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Luna's Kitchen" />
<meta property="og:locale" content="en_US" />
<meta property="og:image" content="https://lunaskitchen.com/assets/ht/share/menu.png?v=3f9a2c71d0" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Our menu · Luna's Kitchen" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@lunaskitchen" />
<link rel="icon" href="/favicon.ico" sizes="32x32" />
<link rel="icon" href="/icon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta name="theme-color" content="#e4572e" />
<script type="application/ld+json">{ ... }</script>

Each value comes from the first place it’s set:

Tag Comes from
<title> The page’s title, put through titleFormat from its folders’ _defaults.yaml, then site.yaml, then {{ page.title }} · {{ site.name }}. A page with no title uses the site’s name.
description The page’s description, then the site’s.
og:title The page’s shareTitle, then its title (without titleFormat), then the site’s name.
og:description The page’s shareDescription, then the description above.
og:image The page’s image, then the site’s. Without either, a share card is drawn for the page, 1200 × 630, at /assets/ht/share/<page>.png: white, with the site’s logo at the top, the page’s share title large (in as many as three lines, made smaller to fit, and cut short after that), the site’s name and domain at the foot, and a bar of its themeColor along the bottom. An image of the page’s own is used at its own shape, made smaller if it’s bigger than 1200 wide. The 404 page has none.
og:image:alt The image’s alt text, or the share title when the image has none. A share card’s alt text is its title.
canonical and og:url The page’s canonical, for a copy of something published elsewhere. Otherwise the site’s primary domain and the page’s URL, so www, the bare domain and the site’s hypertekt.page address never compete.
og:type The page’s type, then website.
og:locale, <html lang> The site’s language.
twitter:card summary_large_image, or app for a page with an app.
twitter:site, twitter:creator social.twitter in site.yaml, and the page’s author if it has a twitter field.
icons and manifest The page’s favicon (a file in assets/, or a list of them), then the site’s. Without one, favicon.ico, icon.svg, favicon.svg and favicon.png in public/. Without those, the icons are drawn from the site’s icon, or from its logo when the site has no icon, fitted into a square: favicon.ico (16, 32 and 48), and icon.svg too when icon is an SVG. The Apple touch icon (180, on the themeColor or white, since it can’t be see-through) and site.webmanifest with Android’s 192 and 512 icons are drawn the same way, unless public/ (or pages/, for the manifest) already has that file.
theme-color The site’s themeColor.

A page with noindex: true also gets <meta name="robots" content="noindex" />.

An image in front matter or site.yaml is written as its path in assets/, or as the path with its alt text:

image: { path: duck-tabata/link_cover.png, alt: Five ducks doing burpees }

A page about a mobile app gets an app card, with links to its stores, and the home page describes the app in its structured data (see below). app can have name, iphone and ipad (App Store IDs), googleplay (a package name) and a schema.org category, like GameApplication:

---
title: Duck Tabata
type: game
app:
  name: Duck Tabata
  category: HealthApplication
  iphone: "1567452386"
  googleplay: co.manyducks.ducktabata
---

Templates don’t write these tags, and there’s no way to turn them off. A template that writes one is an error (head-managed) that points to the front matter key to use instead. That keeps every page’s metadata right, even after someone edits a layout. Other tags, like og:video, article:published_time or a verification tag, can go in the head slot as usual.

site.yaml

name: Luna's Kitchen # required
url: https://lunaskitchen.com # required
language: en-US
timezone: America/Los_Angeles
description: Seasonal small plates and natural wine in Portland.
image: share.jpg # in assets/, or { path: share.jpg, alt: … }
favicon: favicon.svg # in assets/; or a list of them, or icons in public/
viewportFit: cover # only for a site whose CSS pads for the notch with env(safe-area-inset-*)
logo: logo.svg # in assets/, for share cards, icons and structured data
icon: mark.svg # in assets/: a square mark the icons are drawn from, when the logo is too wide to read small
themeColor: "#e4572e" # #rgb or #rrggbb: share cards' bar, the Apple icon's background, theme-color, the manifest
analytics: false # turns off the visitor counting every site has (see "Scripts and analytics"); it's on otherwise
# or, to choose what counts as a visit reaching a goal: analytics: { goals: [booking, form:contact] }
titleFormat: "{{ page.title }} · {{ site.name }}"
layout: base
social:
  twitter: "@lunaskitchen"
business:
  type: Restaurant # a schema.org type, or a list of them: [LocalBusiness, Gym, PersonalTrainer]
  phone: "+1 503 555 0100"
  email: hello@lunaskitchen.com
  address: { street: 1234 SE Belmont St, city: Portland, region: OR, postcode: "97214", country: US }
  geo: { lat: 45.5163, lng: -122.6489 } # for maps and structured data; the dashboard finds it from the address
  hours: # a day or a list of days, and when it opens and closes; owners change them in Content, under Business
    - { day: [Tuesday, Wednesday, Thursday, Friday, Saturday], opens: "08:00", closes: "21:00" }
    - { day: Sunday, opens: "09:00", closes: "15:00" }
  specialHours: # days the hours aren't as usual: a date, or from and until; closed, or opens and closes; and why
    - { date: 2026-12-25, closed: true, note: Christmas }
    - { from: 2026-12-26, until: 2026-12-31, opens: "09:00", closes: "12:00", note: Holiday hours }
  priceRange: $$
  links: [https://instagram.com/lunaskitchen] # profiles elsewhere

The keys above are checked, with their types (invalid-site), and so are the keys inside business and social. Templates can read every field of business and social, like site.business.phone, whether or not the site writes it: a field the site doesn’t write is empty. A site can have keys of its own too, for templates to read as site.<key>, but a key that’s a likely typo of one the engine reads is a warning.

A business that isn’t somewhere people visit, like a software company, uses type: Organization (or Corporation, NGO, EducationalOrganization and the like) and needs no address, hours or phone. A person’s own site uses type: Person, with their name. A site’s apps come from the pages about them, through each page’s app front matter, so each app is only written once:

business:
  type: Organization
  email: support@manyducks.co

Structured data

The engine also writes schema.org JSON-LD, which search engines use for rich results:

  • Every page: WebSite, and below the home page a BreadcrumbList: the home page, each page above this one that exists (/projects/duck-tabata above /projects/duck-tabata/privacy), and this page, by their titles.

  • The home page: the business from site.yaml, as its type, with its address, location, phone, email, hours, price range, logo and links. For a local business this is what puts it on the map in search results. hours is a list written in site.yaml, each with a day (or a list of days), opens and closes, and anything else is an error (invalid-site). specialHours are the days when the hours aren’t as usual, written as specialOpeningHoursSpecification (a closed day opens and closes at midnight). A special day that’s over, after the end of its last day in the site’s time zone, is left out of the structured data and of site.business.specialHours. The site is built again when the next special day is over (the manifest’s rebuildAt). Each special day needs a date (or from and until), and either closed: true or opens and closes. Anything else is an error (invalid-site). Every page with an app is described as a MobileApplication, with its name, page, description, image, category and store links.

  • One page per item: a collection can say what its items are with describes, and which fields mean what:

    # collections/events.yaml
    label: Events
    describes: { type: Event, name: title, startDate: starts, endDate: ends, location: venue, image: photo }
    fields: ...

    The types describes knows are Article, Event, Product, MenuItem, Service, Person, FAQPage, JobPosting, Recipe, Course, VideoObject, LocalBusiness, SoftwareApplication and MobileApplication. The checker checks that the fields exist and have the right types, and that the fields search engines require for that type are there.

  • Businesses with more than one location: a collection that describes a LocalBusiness (or one of its types, like Restaurant) gives each location’s page its own address, phone and hours. The home page then describes the business as an Organization, with the locations as its parts.

For anything else, a page can write its own JSON-LD with structuredData, which is written after the engine’s:

---
title: The Belmont Street Band
structuredData:
  "@context": https://schema.org
  "@type": MusicGroup
  name: The Belmont Street Band
  genre: Jazz
---

structuredData can be one thing or a list of things, each written in its own script. It’s checked as JSON-LD (structured-data): each thing has to have a schema.org @context and a @type. Like any other front matter value, it can use {{ }}. structuredData is for types describes doesn’t know: use describes wherever it fits, since describes is checked against the collection and stays right as items change.

Search engines don’t show star ratings that a business publishes about itself, so ratings and reviews aren’t in describes.

Sitemap and robots

  • sitemap.xml lists, in order of their URLs, every HTML page except 404.html, pages with noindex and pages whose canonical is somewhere else, with the time each page last changed: the time of the build that last changed what the page says. A change to a stylesheet or an image the page links to doesn’t count, so a new stylesheet doesn’t tell search engines every page is new.

  • robots.txt lets everything in and points to the sitemap:

    User-agent: *
    Allow: /
    
    Sitemap: https://lunaskitchen.com/sitemap.xml
    
  • Previews and drafts are never indexed: they’re served with noindex and a robots.txt that keeps everything out.

Moved pages

The engine remembers every URL a page has had. When a page’s file is renamed, or an item’s slug changes, the old URL redirects to the new one (a 301), so links from elsewhere and search rankings carry over. A deleted page returns 410 Gone, with 404.html, so search engines drop it quickly. A page counts as deleted when the last build had it, this build doesn’t, and no redirect covers its URL. The URL returns 410 for 90 days, then 404 like any other URL that doesn’t exist. It stops returning 410 sooner if a page or a redirect is at that URL again. A URL that never existed returns 404 with 404.html, never a redirect to the home page.

Serving

What a URL gets, in this order:

  1. The page or file at exactly that URL.
  2. If the URL ends with a slash, a redirect (301) to the URL without the slash, or straight to where redirects.yaml sends that URL.
  3. If the URL is a folder in public/ with an index.html (see Files at exact paths), a redirect to the same URL with a slash at the end.
  4. A redirect from redirects.yaml.
  5. A page that’s been deleted (see Moved pages): the site’s 404.html, with a 410.
  6. The site’s 404.html, with a 404. A site without one gets a plain page that says there’s nothing there. A URL that doesn’t exist is never sent to the home page.

404.html is only ever shown for URLs that don’t exist: /404 isn’t a page of its own. 404.html is written with noindex and without a canonical URL.

Redirects

redirects.yaml lists URLs that go somewhere else: old URLs from before a site moved to Hypertekt, short links, and pages that moved to other sites.

/letterattack: /projects/letter-attack
/letterattack/*: /projects/letter-attack/* # everything under it, keeping the rest of the path
/punch: https://github.com/tonymccoy/punch # another site
/orbit: { to: "https://orbit.tonymccoy.me", status: 302 } # 301 unless it says otherwise
  • A redirect is from a URL on the site, starting with /. It goes to a path on the site or a full http or https URL. The status is 301 (moved for good) unless the redirect says 302 or 307 (moved for now), 303 or 308.
  • /folder/* is everything under /folder, but not /folder itself. A * at the end of the redirect’s destination stands for the rest of the path. When more than one /folder/* fits, the longest wins, and a redirect from exactly the URL wins over all of them.
  • A query string (?ref=…) is kept, unless the destination has a query string of its own.
  • A redirect only applies where there’s no page. A redirect that a page or file hides is a warning (hidden-redirect), and so is a redirect to a path on the site where there’s nothing (broken-link).
  • /_forms/ and /_ht/ are Hypertekt’s own, for forms and the visitor counting, so a redirect from there is an error (reserved-url).
  • URLs are matched without a slash at the end, as every URL is. /letterattack/ goes to /projects/letter-attack too.

Files at exact paths

public/ holds files that have to be at an exact URL, served as they are: no hash in the name, never a template. For example: favicons someone made by hand, site.webmanifest, ads.txt, .well-known/ files, Apple’s domain association, or a small app of plain HTML and JavaScript.

  • A file is served with the content type for its extension. A file with no extension is application/json if it holds JSON (as .well-known/matrix/server does), and text/plain otherwise. headers in site.yaml can set a different content type.
  • Folders starting with a dot, like .well-known/, are served. Nothing else that starts with a dot is served.
  • A file or folder whose name starts with _ is served too, unlike in pages/ and content/: a file here is at exactly its name. Except under /_forms/ and /_ht/, which are Hypertekt’s own: a file there is an error (reserved-url).
  • A folder in public/ with an index.html, like public/comparify/, is served at /comparify/. This is the one place a URL keeps its slash at the end: files in public/ aren’t changed, and their relative links need the slash. /comparify redirects to /comparify/.
  • A page in pages/ at the same URL as a file in public/ is an error (url-clash), and so are two pages at one URL, like about.html and about/index.html.

Response headers

Every response has safe headers to begin with: X-Content-Type-Options: nosniff, Referrer-Policy: strict-origin-when-cross-origin, a Permissions-Policy that turns off what sites rarely use (camera=(), microphone=(), geolocation=(), payment=(), usb=(), browsing-topics=()), and Content-Security-Policy: frame-ancestors 'self' so other sites can’t put the site in a frame. headers in site.yaml adds to these headers, or changes them, for a path: exactly that path, or everything under a /folder/*. When more than one path fits, their headers are applied in the order they’re written, so a later one wins. A header’s name has to be a valid header name, and its value has to be text (invalid-site).

headers:
  /.well-known/matrix/*:
    Content-Type: application/json
    Access-Control-Allow-Origin: "*"
  /embed/*:
    Content-Security-Policy: frame-ancestors *

Other hosts

Every domain the site has redirects (301) to the primary domain, the host in site.yaml’s url, keeping the path and the query string. The exception is hosts in site.yaml: a host listed there serves the paths listed for it (exactly, or everything under a /folder/*) itself, over HTTPS, without redirecting. Every other path on that host redirects, as on any other host:

hosts:
  mta-sts.manyducks.co: [/.well-known/mta-sts.txt]
  manyducks.co: [/.well-known/matrix/*] # the bare domain, when www is the primary one

Search checks

Checking and building look for what hurts a page in search, and report it as warnings. Most of these checks read the pages as they’re built, so a page made for each item is checked with what its item gives it. The same problem on many pages from one template is one warning that lists the pages:

Code When
missing-title A page other than the home page has no title.
title-length The full title, through titleFormat, is longer than 60 characters, so search results would cut it off. A title written with markup is measured as it’s written: use plain (see Pipes).
missing-description Neither the page nor the site has a description.
description-length The description is shorter than 50 characters or longer than 160. One that comes from site.yaml is reported there, once.
duplicate-title A page has the same title as another, or the same description of its own. Pages that share the site’s description don’t count.
missing-alt An <img> written in a template has no alt, or a picture in an item’s markdown has no alt text. Write alt="" for an image that’s only decoration.
heading-count A page has no <h1>, or more than one.
heading-order A heading skips a level, like an <h4> straight after an <h2>.
broken-link A link on a page (<a href>, to a path on the site or the site’s own URL) goes where there’s nothing: no page, file or redirect. Or the link goes to a place on one of the site’s pages, #…, and no element on that page has that id. #, #top, text fragments (#:~:text=) and links with data-consent-settings don’t need an id.
missing-business site.yaml has no business, or a business people visit (any type but Organization, Person and the like) has no address or phone.

A page kept out of search, with noindex or a canonical somewhere else, only gets the heading and link checks. The 404 page gets none. These checks also show in the dashboard as one list for the whole site.

Accessibility checks

Checking and building also look for what makes a site hard to use with a screen reader, a keyboard or low vision, as warnings. Like the search checks, most read the pages as they’re built (the 404 page too), and one problem on many pages is one warning that lists the pages. The warning points at where the problem is written: the page, its layout, a partial, or the item it came from. missing-alt and the heading checks above count for both search and accessibility.

Code When
link-text A link whose words don’t say where it goes, like “click here”, “read more” or “learn more”, which a screen reader reads out of context in its list of links. Words only screen readers get, or aria-label, count.
empty-link A link with no words at all: a picture with an empty alt, or an icon with no name.
missing-label An <input>, <select> or <textarea> with no label: it isn’t inside a <label>, no <label for> points at it, and it has no aria-label. A placeholder isn’t a label.
empty-heading A heading with nothing a screen reader can read in it.
alt-text Alt text that’s a file’s name (IMG_2041.jpg) or only says it’s a picture (image, photo).
low-contrast A rule in a stylesheet (in assets/, public/ or a template’s <style>) whose text color and plain background color are under 4.5 to 1, or 3 to 1 for large text (24 pixels, or 18.66 and bold).
positive-tabindex A tabindex above 0 in a template or snippet, which takes the element out of the order people move through the page in with the keyboard.

The contrast check follows a color written as a custom property to the value :root sets for it, and leaves out what it can’t know: a color that’s see-through, or a background that’s a picture or a gradient. A site with a dark version is checked in both: the dark one with the colors :root sets inside @media (prefers-color-scheme: dark) in place of its others, and the second color of each light-dark(). A problem in only one of them says which (“in dark mode”). The platform’s own components pass every accessibility check.

Scripts and analytics

There are three ways to add scripts, from the simplest to the most open.

Integrations. Well-known services are set up with just an ID in site.yaml, and the engine writes their code correctly on every page, in the right place:

integrations:
  googleAnalytics: G-XXXXXXXXXX
  googleTagManager: GTM-XXXXXXX
  metaPixel: "123456789012345"
  googleAds: AW-446963602
  plausible: lunaskitchen.com
  goatCounter: tonymccoy # or { code: stats, url: https://stats.tonymccoy.me } for one you run yourself
  googleSiteVerification: abc123 # writes the meta tag Search Console asks for

The keys are googleAnalytics, googleAds, googleTagManager, metaPixel, clarity (Microsoft Clarity), plausible, fathom, goatCounter, googleSiteVerification and bingSiteVerification. More come as people ask for them. Each ID is checked against what that service’s IDs look like, and a key that isn’t one of these is an error (invalid-site). Google Analytics and Clarity are analytics for consent (see below); Google Ads, Tag Manager and the Meta Pixel are marketing; Plausible, Fathom and GoatCounter don’t use cookies, so they’re none and never wait. Tag Manager’s <noscript> frame isn’t written: without JavaScript there’s no way to ask for consent, and the frame would load without it.

Snippets. Many services say “paste this code into your site”. A snippet is that code, kept as it was pasted, in snippets/<name>.html, with front matter saying where it goes:

---
label: Chat widget
place: body-end # head, body-start or body-end
pages: all # or a list of paths: [/contact, /menu/*]
consent: functional # none, necessary, functional, analytics or marketing
---
<script src="https://widget.example.com/loader.js" data-account="4821" async></script>
  • place is where the snippet goes on each page: the end of the <head> (head), just after <body> (body-start), or just before </body> (body-end). It’s body-end if the snippet doesn’t say.
  • pages is all (if the snippet doesn’t say), or a list of paths, where * stands for anything: /menu/* is every page under /menu, but not /menu itself. A path with no page at it is a warning (invalid-snippet), since it’s likely a typo.
  • consent is required, so nothing waits, or runs, by accident. When it’s functional, analytics or marketing, the snippet’s scripts wait for consent like an integration’s scripts do (a module stays a module, and the scripts run in the order they’re written). Its <iframe>s and <img>s don’t load until the visitor agrees: each one’s address is kept aside until then. What’s in <noscript> is left out, since it would load without asking. Data, like type="application/ld+json", runs nothing, so it’s written as it was.
  • The code is never a template: {{ in it is written as it is.
  • Snippets are written in the order of their files’ names, and none are written in previews.
  • A new file in snippets/ starts as a skeleton with each key and what it can be.

Scripts in templates. A developer can write <script> tags in layouts and pages like any other HTML. A template’s values are written into a script with the json pipe, as always. Code with {{ in it can be pasted inside {{#verbatim}} … {{/verbatim}} and is written as it is.

JavaScript libraries, like a carousel or a map, go in assets/ as files, never loaded from someone else’s server at a version that can change.

What every script gets

  • Consent. Every integration, snippet and embed has a consent category: none for things that store nothing on the visitor’s device, necessary, functional, analytics or marketing. Scripts in the last three are written so they don’t run, and the platform’s consent script runs them once they’re allowed. Where the law asks for consent first (the EU, the EEA, the UK and Switzerland, and anywhere the server can’t tell which country the visitor is in), a visitor gets a cookie banner, and nothing in a category runs until the visitor agrees to that category. The choice is kept in the visitor’s browser. Everywhere else, the scripts run right away and there’s no banner. Google’s tags get Consent Mode signals, denied until they’re allowed. Anything with data-consent-settings, like a “Cookie settings” link in the footer, opens the banner again, and is hidden where visitors aren’t asked. A site with only none and necessary scripts, and the built-in analytics, has no banner anywhere.
  • Built-in analytics. Every site on Hypertekt counts its visitors, pages, referrers and actions like tapping the phone number, with no setup, no cookies and no banner, and measures how fast pages load for real visitors (Core Web Vitals). Everyone with access to the site sees these numbers in its dashboard. Hypertekt counts each page as it’s served, and a small script the engine adds to the published site (ht/analytics.js, never in a preview) sends what only the browser knows: taps on tel: and mailto: links and on links to Google Maps or Apple Maps, and how fast the page felt. It stores nothing in the visitor’s browser, so it sits outside the consent categories, never waits, and needs no banner. Other analytics are for people who want more.
    • Anything else worth counting is marked with data-ht-action and a name for it, on a link or a button: <a href="https://booking.example.com/luna" data-ht-action="booking">Book a table</a>. A tap on it, or on anything inside it, is counted by that name. The dashboard calls it what it says (“Book a table”), or by its aria-label when it’s only an icon.

    • Goals. The dashboard’s Visitors tab says how many visits reached a goal. By default that’s every tap the site counts: calls, emails, directions, forms sent (form: and the form’s name) and its own data-ht-actions. A site whose main goal is one of them, like booking a table, chooses it in site.yaml, and then only those count:

      analytics:
        goals: [booking]

      Each goal is a name as taps are counted (call, email, directions, form:contact, booking). One no page has a link, button or form for is a warning (unknown-goal), since no visit could reach it. A site that has a clear goal, like a booking or order link to another site, marks it with data-ht-action and names it here.

    • analytics: false in site.yaml turns it off: no script, and nothing counted.

  • Not in previews. Integrations and snippets don’t run in the editor’s preview, in drafts, in tekt start (only verification tags are written), so the owner’s visits don’t count as visitors. Scripts in templates do run there, since they’re usually part of how the site works.
  • Speed. Scripts in the <head> that aren’t async or defer hold up the page. The checker warns about a <script src> in a template’s <head>, or in a snippet placed there, that isn’t async, defer or a module (blocking-script). An inline script, written inside the <script> tag itself, can’t be deferred and is usually small, so the checker leaves it alone. Integrations are always written so that they don’t hold up the page.

Types

The checker knows the type of every value:

Type What it is
text Plain text. Escaped wherever it’s written.
html HTML that’s safe to write as it is: rich text fields, and what markdown and raw give back.
number A number.
boolean Yes or no.
date A date, or a date and time, in the site’s time zone.
url A URL. Written as text, and checked in URL attributes.
image An image: .url, .alt, .width, .height and .focus (the point to crop around). Written as its URL.
list<T> A list of values of one type.
item<name> An item from a collection, with the fields in its schema.
object A group of named fields inside an item, like a track with a name and a length.
T? A value that might be empty.

Front matter values have the types they’re written with: title: Our menu is text, opened: 2016-05-01 is a date, seats: 40 is a number, and a list or a group of keys is a list or an object. Where a layout reads an image, a path in assets/ counts as an image.

Collections

A collection’s schema is a YAML file in collections/. collections/menu.yaml:

label: Menu
fields:
  name: { type: text, required: true }
  slug: { type: slug, from: name }
  summary: { type: text }
  category: { type: choice, options: [Starters, Mains, Desserts], required: true }
  price: { type: number }
  description: { type: richtext }
  photo: { type: image }
  vegan: { type: boolean }
  tags: { type: list, of: text }
  chef: { type: reference, to: staff }
order: [category, name]
Field type Template type Notes
text text multiline: true for a text area in the content form. min and max lengths.
richtext html Cleaned of scripts and unsafe attributes when saved.
markdown text Kept as Markdown. Use the markdown pipe to write it.
number number min, max, step.
position number Where an item comes in the collection, kept by the dashboard as items are dragged into order.
boolean boolean
date date time: true to include a time.
choice text One of options.
slug text For URLs. Made from the from field unless it’s set.
url url
email text
phone text A phone number, kept as it was written. The tel pipe makes a link for it.
image image Uploaded into the site’s assets, or copied in from a URL, so nothing depends on another site.
reference item<to> Another collection’s item.
list list<of> A list of another field type. min and max items.
object object Named fields of their own (fields:), inside the item. Usually in a list.

A list can hold objects, for things that belong to one item and nothing else:

# collections/albums.yaml
fields:
  title: { type: text, required: true }
  slug: { type: slug, from: title }
  artist: { type: reference, to: artists, required: true }
  tracks:
    type: list
    of:
      type: object
      fields:
        name: { type: text, required: true }
        length: { type: text }
        comment: { type: text }

Every image has alt text: the content form asks for it. Every image has a focus too, the point that has to stay in the picture when it’s cropped. The focus is the middle of the image unless someone moves it. An icon (an SVG, or a picture 160 pixels across or less) isn’t cropped, so the content form shows it whole and larger, on a checkerboard that shows its own colors, without a focus point to move.

A field that isn’t required has an optional type (price is number?). Every item also has id, created and updated. order is the order the collection’s items come in when a template doesn’t sort them.

A collection whose items go in an order someone chooses, like a team’s trainers or a menu’s sections, has a position field. The position is a number, and the collection is ordered by it unless order says otherwise. In the dashboard, an owner drags the items into order, and each item’s position is written as 1, 2, 3 and so on. Only the items that moved are rewritten, in one commit, without changing their updated. The content form doesn’t show the position field, and a new item goes at the end. An item without a position comes after the items that have one. A collection can have at most one position field, among its own fields (not inside an object or a list), and a form can’t list it.

# collections/trainers.yaml
fields:
  name: { type: text, required: true }
  position: { type: position }

Any field can have a default, which is used when an item is made without the field. A field can also have a label and help for the content form: label is what the form calls the field when that isn’t its name, and help is a line under the field saying what it’s for. Write help for the owner who’ll read it in the form, not as a note to developers. The Code tab shows the same help when the pointer is over the field’s name: in its schema, in an item or front matter, and in a template ({{ trainer.role }}). A field’s explanation is written once, where the field is, rather than in a comment above it.

A collection can also say:

  • private: true: templates can’t read it. Its items are only for the dashboard and server functions. A template that uses it is an error (private-collection).
  • publish: field: templates only see the items where that yes/no field is yes.
  • keep: 1 year (or days, weeks or months): items older than this are deleted.
  • body: field: the markdown, rich text or text field that’s the body of an item’s .md file. See Where items are kept.

These matter most for collections that forms fill. See Forms.

A collection can also have a feed, which the engine writes as RSS and Atom, with a link to both in the <head> of every page:

feed:
  path: /blog/feed.xml # and /blog/feed.atom
  title: Tony's blog
  description: Opinions and thoughts of a person on the internet. # the site's description if left out
  content: body # the field with each item's full text
  date: published # created if left out
  categories: tags # a list field, whose values are each entry's categories
  • Each entry is an item that has a page. Entries are newest first, and each is titled by the item’s title field, or its name. An entry links to its item’s page, so a collection with a feed needs a page per item (no-item-page). Links in an entry’s text are written as full URLs.
  • The feed is dated by its newest entry, so building again without a change gives the same feed.
  • A path that doesn’t end in .xml, or a field that isn’t there or isn’t the right kind, is an error.

For a feed of anything else, write the template yourself (see XML, JSON and text).

The content forms are made from these schemas, and every write, whether from a form or a server function, is checked against them.

Where items are kept

Each item is a file in content/, named for its id: content/<collection>/<id>.yaml, with its fields as YAML.

# content/albums/emperor-of-sand.yaml
title: Emperor of Sand
artist: mastodon # the id of one of the artists
released: 2017-03-31
cover: { path: listening/emperor-of-sand.jpg, alt: A figure walking through a desert }
tracks:
  - { name: Sultan's Curse, length: "4:09" }
  - { name: Show Yourself, length: "3:02" }

A collection whose items are mostly writing can say which of its fields is the body of a .md file, with body:. Its items are then content/<collection>/<id>.md: the other fields as front matter, and the body field as everything after the front matter.

# collections/posts.yaml
fields:
  title: { type: text, required: true }
  published: { type: date, required: true }
  tags: { type: list, of: text }
  body: { type: markdown, required: true }
body: body
<!-- content/posts/onyomi-or-kunyomi.md -->
---
title: When to use おんよみ vs くんよみ
published: 2021-06-13
tags: [japanese, language notes]
---

くんよみ is usually used for reading kanji in words with a single kanji as its root.
  • The file’s name is the item’s id: letters, digits, - and _. The id isn’t written inside the file.
  • A reference is written as the id of the other item (artist: mastodon). In a template, the reference is that item itself, so albums | where "artist" artist finds an artist’s albums.
  • An image is a path in assets/, or { path, alt }, with a focus: { x, y } from 0 to 1 when the focus has been moved. Front matter that a layout or a collection reads as an image is written the same way.
  • A slug that isn’t written is made from its from field when the site is built.
  • created and updated are written by whatever saves the item: a content form or a server function. An item written by hand without them has none.
  • A file or folder whose name starts with _ is a draft, and left out, as in pages/.
  • showFrom and showUntil say when an item is on the site, and every item (and every page, in its front matter) can have them, so a schema can’t have fields of those names. Each is a date (2026-12-01) or a date and time (2026-12-01T09:00), in the site’s timezone: showFrom counts from the start of its day, and showUntil through the end of its day. A time with an offset (Z, -08:00) means exactly that moment. While an item is outside those times, it’s left out of its collection, so no page lists it and no page is made for it. A page outside those times isn’t built at all. Templates can read showFrom and showUntil, as dates. A showUntil that’s before the item’s showFrom is an error. The site is built again by itself when the next showFrom or showUntil comes.
  • Saving one item changes one file, so the site’s history shows each change on its own. Only the lines that changed are written again: the rest of the file, with its comments, the order of its keys and its quotes, stays as it was. A new file is written like the examples here, with groups of fields and lists of plain values on one line when they fit.

Every item’s file is checked like any write: a field that isn’t in the schema (unknown-field), a required field that’s missing (missing-field), a value of the wrong type or not one of a choice’s options (field-type), a reference to an item that doesn’t exist (broken-reference). Each problem is reported on the line of the value it’s about.

Collections of pages

Some pages are data as well as pages: each of a company’s apps has its own page, written by hand, and the home page lists them with their icons and release dates. A collection can say which pages are its items with pages, a pattern of their files in pages/ (* is any one folder or file name, ** any number of folders). collections/apps.yaml:

label: Apps
pages: projects/*/index.html
fields:
  released: { type: date, required: true }
  icon: { type: image, required: true }
  summary: { type: markdown, required: true }
order: [-released]
  • Each page’s front matter is the item: its keys are the item’s fields, checked against the schema like any item’s fields. A required field that’s missing is an error (missing-front-matter), and so is a value of the wrong type or not one of a choice’s options (front-matter-type). A key that isn’t a field, part of the page’s metadata, or a key the page’s layout reads is an error too (unknown-field), and the error names the field the key is likely a typo of. An image is a path in assets/, or { path, alt }.
  • Templates read the pages as the collection, like any other: {{#each apps | group "released" date="yyyy" as year}}. Each item also has the page’s metadata (title, description, image, app and the rest), the page’s url, and the page’s path, which is the item’s id. These items have no created or updated.
  • {{ app | url }} is the page’s URL.
  • A page can be an item of only one collection. A page made per item ([slug].html) can’t be an item, and a collection of pages can’t be private.

Forms

A form is something visitors send: a contact form, a catering request, a booking inquiry, a review. A form is the one part of a site that isn’t built ahead of time. Each thing a visitor sends is a submission. A submission is kept as an item of a collection, so the owner browses, searches, edits and downloads submissions the same way as any other content.

A form has a file in forms/ that says which collection the form fills, which of the collection’s fields visitors fill in, and what happens when a submission is sent. forms/contact.yaml:

label: Contact
collection: inquiries
fields: [name, email, topic, message] # the fields visitors fill in, in this order
notify: [owner] # who gets an email: owner, and the emails of people on the site
replyTo: email # the field the email's Reply-To comes from, so the owner can just press reply
success: Thanks! We'll get back to you within a day. # or { redirect: /contact/thanks }

The collection is an ordinary one, with fields for what visitors send and, if the owner wants them, fields for the owner that visitors never see. collections/inquiries.yaml:

label: Inquiries
private: true # templates can't read it
keep: 1 year # items older than this are deleted
fields:
  name: { type: text, required: true, max: 100 }
  email: { type: email, required: true }
  topic: { type: choice, options: [General, Catering, Private events] }
  message: { type: text, multiline: true, required: true, max: 5000 }
  status: { type: choice, options: [New, Replied, Done], default: New } # the owner's, not the visitor's
  notes: { type: text, multiline: true } # the owner's
order: [-created]
  • A form’s fields have to be fields of its collection, and can’t be reference, image, richtext, list or object fields. Everything a visitor sends is checked against those fields on the server, whatever the browser did, min and max included (a text field’s length, a number’s size). A field the form doesn’t list gets its default, and a required field the form doesn’t list needs a default.
  • notify is everyone who gets an email about each submission: owner, and any other email addresses (notify: [owner, theo@kettlebrook.example, desk@kettlebrook.example]). Each address gets its own copy, so nobody sees who else got the email, and one address that’s refused doesn’t stop the rest. Each address gets one copy, however often it’s listed and however it’s capitalized, so an owner who’s also listed by their address gets one copy. notify is [owner] if it’s left out.
  • success is a message, or { redirect: /a-page }. replyTo is one of the form’s email fields. The checker checks a form’s file against its collection (invalid-form).
  • A collection that a form fills has to be private, or say which field publishes an item (see Showing what visitors send). The checker won’t let visitors write straight onto the site.
  • keep sets how long items are kept. It’s 1 year for a collection a form fills, unless the collection says otherwise.
  • spamCheck: false turns the spam check off (see below). It’s on for every form unless the form’s file says so.

In a template

The form block writes the <form> tag and everything a form needs that isn’t a field:

{{#form "contact" class="contact-form"}}
  <label>Your name <input name="name" autocomplete="name" /></label>
  <label>Email <input name="email" type="email" autocomplete="email" /></label>
  <label>
    What's it about?
    <select name="topic">
      <option>General</option>
      <option>Catering</option>
      <option>Private events</option>
    </select>
  </label>
  <label>Message <textarea name="message"></textarea></label>
  <button>Send</button>
{{/form}}
  • The block writes method, action (the site’s own /_forms/contact), the fields and the Turnstile widget that protect the form from bots, and a place for the success or error message (data-ht-form-status, which becomes sent or error). Other attributes, like class, are passed through. A page with a form gets the form’s script and Turnstile’s.
  • With JavaScript, the form is sent without leaving the page: the page shows the message without a reload, or goes to the redirect page, and the inputs with problems get aria-invalid. Without JavaScript, the page loads again with the message in place.
  • The form is checked against its file and collection (form-input). Every name has to be one of the form’s fields, and every required field needs an input. An input’s type has to fit its field (email for an email field, tel for phone, checkbox for boolean), a <textarea> is for text, and the options in a select have to be the field’s choices. Missing required, maxlength, minlength, min, max and type attributes are added from the schema, so the browser checks the same things the server will. A form that isn’t in forms/ is an error (unknown-form).
  • The starter components include a ready-made contact form, {{> contact-form form="contact"}}, which writes the inputs from the schema.

What happens when a form is sent

  1. Bots are stopped first. Every form has Cloudflare Turnstile (it’s invisible to almost everyone) and other protections of its own. A submission that fails them is turned away.

  2. The submission is checked against the form’s fields. A visitor gets the same messages the browser would have shown.

  3. The filter runs, if the form has one: a server function with a form trigger for this form. The filter is given the submission and decides what happens to it:

    // functions/filter-contact.ts
    export default defineFunction({
      triggers: [{ form: "contact" }],
      async run({ submission }) {
        if (/seo services|crypto|backlinks/i.test(submission.message)) {
          return { spam: true, reason: "Sales pitch" };
        }
        if (submission.topic === "Catering") {
          return { notify: ["catering@lunaskitchen.com"], set: { notes: "Sent to the catering team" } };
        }
      },
    });

    The filter can return nothing (keep the submission and email it as usual), spam: true (keep it as spam and send no email), spam: false (it isn’t spam, whatever the spam check would say), reject with a message (turn the submission away and tell the visitor why), notify (change who gets the email) or set (fill in the owner’s fields, checked against the schema). A filter has a few seconds to run. If it fails or runs out of time, the submission is kept and emailed as usual, marked so the owner knows the filter didn’t run. A real message is never lost because a filter broke.

  4. The spam check runs, unless the filter already said spam. It’s an automated check for characteristics that spam commonly has. A submission it flags is kept as spam, like one the filter called spam, with a short reason. A real message that shares one characteristic isn’t flagged on that alone. A filter that returns spam: false says the submission isn’t spam, and the check doesn’t run. spamCheck: false in the form’s file turns it off, for a site whose real visitors write the kind of thing spam does, like a marketing agency’s.

  5. The submission is saved as an item in the form’s collection, with created set to the time it was sent. The item also has submission, which holds the form, the page the form was sent from, the referrer (the site the visitor came from) and any utm_ tags in the page’s URL, so the owner knows what brought the visitor. submission also has spam (the filter’s or the spam check’s reason), repeat or filter (why the filter didn’t run) when they apply. The item’s id is the time it was sent, like 2026-11-22-180312-k3f9a1. If the same email address sent the same form in the last 30 days, the submission is marked as a repeat (duplicates: 7 days in the form’s file changes how long), and its email says so (Contact: Sam (again)). submission belongs to the engine: any collection’s items can have it, and it isn’t a field.

  6. The submission is forwarded, if the form has forward: https://…, as JSON to that address, for a CRM or a spreadsheet. A failed forward is retried, and is shown in the dashboard if it keeps failing.

  7. The email goes out, to everyone in notify, with every field written out plainly and, on Hypertekt, a link to the item in the dashboard’s Inbox. The email is sent from Hypertekt’s own address (Luna's Kitchen via Hypertekt <hello@hypertekt.com>) with the visitor’s email as the Reply-To. An email address that doesn’t belong to someone on the site has to be confirmed before it gets any email, so a form can’t be used to send mail to strangers.

There’s no automatic reply to the visitor, since an automatic reply would let anyone send an email to any address by typing that address into the form.

On Hypertekt, submissions are kept in the site’s own storage, not as files in content/: a submission is never in git, a template can’t read it, and a new submission never starts a build. It’s still an item of the form’s collection, and the dashboard shows it as one.

A form sent from a preview or a draft doesn’t email anyone, and the submission isn’t kept in the collection. The submission is shown to the person testing, marked as a test. In tekt start, it’s shown in the terminal, as the item that would be saved and the email that would be sent.

Sending email

Form emails always come from Hypertekt’s own address, through Cloudflare’s Email Service, with the site’s name on them (Luna's Kitchen via Hypertekt <hello@hypertekt.com>) and the visitor’s email as the Reply-To. Form emails only ever go to the business itself, so which address they come from matters less than whether they arrive, and pressing reply writes to the visitor. There’s nothing to set up, no token to keep, and nothing an owner can’t fix. A site can’t send form emails through an email service of its own: a site.yaml whose email names a provider (provider: postmark) is an error (invalid-site).

Each send gives back the Email Service’s id for the message, so what happened to the message can be followed.

A submission is saved before its email is sent. When the Email Service can’t send an email for now (the service is busy, or over a limit), sending is retried, for each address separately. A refusal that retrying won’t fix, like a bad address, isn’t retried. The dashboard shows the reason, and the owner is told in an email from Hypertekt itself.

Browsing what visitors send

A collection a form fills shows in the dashboard like any other, with a few things added:

  • New items are marked until someone opens them, and the dashboard shows how many are new.
  • Spam is kept out of the list, in its own view, for 30 days, so a real submission caught by mistake can be moved back. After 30 days, spam is deleted.
  • Replying from an item opens the owner’s email with the visitor’s address filled in.
  • Everyone with access to the site can read the items. Owners and developers can edit them, delete them and download them all as a spreadsheet.

A private collection never changes the site, so a new item doesn’t start a build.

Showing what visitors send

A collection can let some of its items onto the site, like reviews, once the owner says so. publish names a yes/no field, and templates only ever see the items where it’s yes:

# collections/reviews.yaml
label: Reviews
publish: approved
fields:
  name: { type: text, required: true }
  quote: { type: text, multiline: true, required: true, max: 600 }
  approved: { type: boolean, default: false }
# forms/review.yaml
label: Leave a review
collection: reviews
fields: [name, quote]
notify: [owner]
success: Thank you! Your review will appear once we've read it.

A review comes in with approved false, so the review is only on the site once the owner checks approved, and unchecking it takes the review down again. Only changes to which items are published start a build. A form can’t fill in the publish field, and neither can a filter.

Standard pipes

T is any type. Arguments in [brackets] are optional.

Text

Pipe Takes → gives What it does
upper, lower text → text Changes case.
capitalize text → text Capitalizes the first letter.
truncate n [end] text → text Shortens to n characters at a word, adding end (…).
trim text → text Removes spaces from both ends.
replace a b text → text Replaces every a with b.
plain text → text Markdown or HTML as plain text, without its markup: for a title written with tags, in front matter’s title.
slugify text → text "Crème Brûlée" → "creme-brulee".
markdown [inline=] [width=] text → html Renders Markdown, with curly quotes, code highlighted, an id on every heading, callouts, and pictures in assets/ in the sizes each screen needs (see below). Safe HTML in it is kept; the rest is shown as text. inline=true renders one line, like a title, with no paragraph around it. width= is how wide its column is, in pixels, so its pictures aren’t made wider than they’re shown.
headings text → list The headings in Markdown, in order, each with level (1 to 6), text and the id that markdown gives it: for a list of what’s on the page.
raw text → html Trusts text as HTML. The checker warns when the text comes from a function or a form.
json T → text The value as JSON, for <script>.
pluralize one other number → text The word for the number, in the site’s language: {{ n }} {{ n | pluralize "drink" "drinks" }}. Also takes zero=, two=, few= and many=.
inline text → html An SVG from assets/, written into the page so CSS can color it. Scripts, event attributes, embedded HTML and javascript: links are taken out.
hours list → list<text> Opening hours, written as business.hours is, as a line each in the site’s language: Mon–Fri 5am–7pm. Three or more days in a row are a range.
specialHours list → list<text> Days the hours aren’t as usual, written as business.specialHours is, as a line each in the site’s language: Fri, Dec 25: Closed (Christmas), Sat, Dec 26 – Thu, Dec 31: 9am–12pm.
tel text → url A tel: link for a phone number: "+1 503 555 0100" → tel:+15035550100.

Numbers and dates

Pipe Takes → gives What it does
plus n, minus n number → number Adds or takes away n.
times n number → number Multiplies by n. times 0.8 is 20% off.
divide n number → number Divides by n. Dividing by zero gives an empty value, and the build warns.
round [decimals] number → number Rounds to decimals places (0 if left out).
number [decimals] number → text Formats for the site’s language: 1,234.5.
money currency number → text "USD" → $12.50.
date format date → text Unicode date tokens: "MMM d, yyyy", "EEEE", "h:mm a", and do for the day as an ordinal (3rd, or 3. in languages other than English).
duration until date → text How long from one date to another, in words: {{ started | duration build.time }} writes 1 year and 5 months. units= chooses which: "years months", the default, or any of years, months, weeks, days, hours and minutes. Less than the smallest unit writes 0 months.

Lists

Pipe Takes → gives What it does
where field [value] list → list Items whose field is yes, or equals value. Also takes ne=, lt=, lte=, gt=, gte=, has=.
sort field... list → list Sorts by fields. "-date" sorts down.
limit n, skip n list → list The first n items, or all but the first n.
first, last list<t> → T? One item.
find field value list<t> → T? The first item whose field equals value.
after item, before item list → list The items after item in the list, or before it, nearest first: posts | sort "-published" | after post | limit 1 is the next older post.
count list → number How many there are.
group field list<t> → list<group> Groups with .key and .items, in the order keys first appear. With date=, a date field is grouped by its formatted date: group "published" date="yyyy" groups by year.
pluck field list<t> → list One field of every item.
values field list<t> → list Every value of a field, each once, in the order they first appear. A list field’s values are taken one by one: posts | values "tags".
sample n list → list n items at random, picked for every visit. Only at the end of an each. See Different on every visit.
join [separator] list → text Joins with separator (", ").

Everything else

Pipe Takes → gives What it does
default value T? → T value when the left side is empty.
get key item or object → T A field whose name is only known when the site is built: {{ site.links | get tech }}.
eq, ne, lt, lte, gt, gte T → boolean Compares with the argument.
includes value list or text → boolean Whether it holds value.
url item → url The URL of the page that renders the item. In .xml and .json templates it’s a full URL, with the domain.
url text → url A path made absolute with the site’s URL.
asset text → url The URL of a file in assets/, with a hash for caching: /assets/site.css?v=3f2a1b9c0d.
resize width= [height=] [format=] image → url The URL of a copy made when the site is built, width wide and never wider than the image. With height=, or after crop, it’s cut to that shape around the image’s focus. format= is avif, webp, jpeg or png; the image’s own if left out.
crop shape image → image The image cut to a shape around its focus, "5:4" or "16:9", with its width and height what’s left. An empty shape leaves it as it is.
srcset [widths] [format=] image → text A srcset: a copy at each width ("400 800 1200", or 400, 800, 1200, 1600 and 2400), leaving out those wider than the image and adding the image’s own width in their place.

HTML in Markdown is kept when it’s one of these, with only these attributes: span, abbr, kbd, mark, sup, sub, small, ruby, rt and rp, with lang, title and class. Anything else is shown as text.

A picture in Markdown, ![What it shows](images/screens/inbox.png), is written as a path in assets/, the way an image field’s path is (./images/…, /images/… and /assets/images/… are the same). A path on the site that isn’t in assets/, like a file in public/ (/files/chart.png), is left as it’s written.

The picture is written the way ht/picture writes an image: a <picture> with copies as AVIF and WebP, and the picture’s own format for older browsers, at 400, 800, 1200, 1600 and 2400 wide, never wider than the picture. With width=, the copies are as wide as the column and twice that for sharp screens, with the widths below that, and sizes says the picture is shown no wider than the column. The picture’s width and height are the size it’s shown at, so the page doesn’t move as the picture loads, and it loads once it’s scrolled to (loading="lazy"). An SVG or a GIF is used as it is. A picture named for sharp screens, like a screenshot taken at twice its size (inbox@2x.png), is shown at half its pixels.

A picture on another site is written as it is, loading once it’s scrolled to, with a warning (outside-picture): it isn’t made in sizes for each screen, and it’s gone when that site takes it down. The Content tab copies such a picture into assets/ when it saves, beside the field’s other pictures, and writes the new path in its place. In an item’s markdown, a picture’s path that isn’t in assets/ is a missing-asset warning, and a picture with no alt text (![](…)) is a missing-alt warning, at its line. A feed’s content has its pictures at their own size, since feed readers make them fit.

A quote whose first line is [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] is a callout, written the way GitHub writes alerts. The marker can be in upper or lower case. A title can follow the marker. Without a title, the callout is titled with the name of its kind (Warning). A quote with any other marker, or with a marker that isn’t on its first line, stays a quote:

> [!WARNING] Before you publish
> Check the preview on a phone.
<aside class="callout callout-warning" role="note">
  <p class="callout-title">Before you publish</p>
  <p>Check the preview on a phone.</p>
</aside>

How a callout looks is up to the site’s own CSS, as the colors of highlighted code are. Style it by the callout class and the class for its kind (callout-note, callout-tip, callout-important, callout-warning and callout-caution). For example:

.callout {
  border-left: 4px solid var(--callout, #0969da);
  padding: 0.5rem 1rem;
}
.callout-title {
  font-weight: 700;
  color: var(--callout, #0969da);
}
.callout-warning {
  --callout: #9a6700;
}

Every heading in Markdown gets an id from its words, so a link can go to it: ## Lists of pages is <h2 id="lists-of-pages">, and /guide#lists-of-pages goes to it. The words are in lower case, with anything that isn’t a letter or a number between them made a hyphen and apostrophes left out (What's on is whats-on). Accents come off Latin letters (Crème brûlée is creme-brulee), and letters in other alphabets are kept as they are (## 漢字の読み方 is 漢字の読み方). A heading with neither letters nor numbers is section. When two headings in one body would have the same id, the second gets -2, the third -3, and so on. An id written on a heading by hand is removed when the HTML is cleaned, so a heading only ever has the id made from its words. headings gives the same ids, for a list of what’s on a page:

<nav aria-label="On this page">
  <ul>
    {{#each page.body | headings | where "level" 2 as heading}}
    <li><a href="#{{ heading.id }}">{{ heading.text }}</a></li>
    {{/each}}
  </ul>
</nav>
{{ page.body | markdown }}

Code in fenced blocks is highlighted when the site is built, for the language after the fence (```js): JavaScript (js), TypeScript (ts), JSX, TSX, HTML, CSS, JSON, YAML (yml), Markdown (md), shell (sh, bash), Python (py), SQL and diff. Code in any other language is left plain, as <pre><code class="language-…">. Highlighted code has GitHub’s light colors, with the dark ones beside them as CSS variables, so a site with a dark mode switches to the dark colors itself:

@media (prefers-color-scheme: dark) {
  .shiki,
  .shiki span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
  }
}

Each token also says what kind it is, as --shiki-site, so a site can color code with its own palette instead. The value of --shiki-site is a variable named for the kind: --ht-code-foreground and --ht-code-background for the code’s own colors, and --ht-code-token- with keyword, string, string-expression (also HTML’s tag names), constant, function (also HTML’s attributes), parameter, comment, punctuation, link, and inserted, deleted and changed for a diff. A site sets the variables it wants, and uses them in place of GitHub’s colors:

:root {
  --ht-code-foreground: #ece9f7;
  --ht-code-background: #14121f;
  --ht-code-token-keyword: #22e4ff;
  --ht-code-token-string: #ffcc33;
  --ht-code-token-comment: #a39dbd;
}

.shiki,
.shiki span {
  color: var(--shiki-site) !important;
  background-color: var(--shiki-site-bg) !important;
}

A token whose kind isn’t set is in the code’s own color, so set --ht-code-foreground at least.

XML, JSON and text

In templates ending .xml, values are escaped for XML, and an HTML value is escaped too, as RSS wants for an item’s description. In .json templates, every value is written as JSON ({{ item.name }} writes "Burrata", and {{ menu | json }} writes the list, not a string of it), and in .txt templates nothing is escaped. In all three, url gives full URLs, since feed readers and the like need them.

Errors

Every problem the checker finds has a file, a line and column, a code, a message and, when it can, a suggestion:

pages/menu/index.html:12:18  unknown-field  "menu" items have no field "titel". Did you mean "title"?
pages/index.html:30:3        missing-prop   {{> card}} needs "title" (text).
pages/index.html:8:5         script-output  Inside <script>, write values with the json pipe: {{ hours | json }}

Codes are stable, so the editor can rely on them. Errors stop a build. Warnings don’t.

The parser finds the problems in this table, before anything is checked against schemas. A file with several problems gets an error for each one, and the parser carries on past each, so one typo doesn’t hide the rest:

Code When
unclosed-front-matter The file starts with --- but there’s no --- line to end the front matter.
unclosed-tag A {{ with no }} before the next {{ or the end, or a comment with no end.
empty-tag {{ }} with nothing in it.
triple-braces {{{ }}}. See Output.
inverted-section Mustache’s {{^x}}. Write {{#if not x}}.
unescaped-ampersand Mustache’s {{& x}}. Write {{ x }}, or {{ x | raw }}.
unknown-block {{#name}} where name isn’t if, each, slot, fill or form.
unclosed-block A block with no closing tag, or one still open when an outer block closes.
unexpected-close A closing tag that doesn’t match the open block, or with no block open.
unexpected-else {{else}} outside if and each, or {{else if}} outside if.
else-after-else {{else}} or {{else if}} after a block’s {{else}}.
else-if-in-each {{else if}} in an each, which can only have {{else}}.
form-attribute method or action on a form block, which writes them itself.
reserved-word One of the language’s words used as a name.
invalid-name A name with characters names can’t have, like first-name.
unexpected-token Something in a tag that doesn’t belong where it is, like a missing as in each.
unexpected-character A character tags don’t use, like < (comparisons are pipes) or + (arithmetic is pipes).
unterminated-string A string with no closing " on its line.

Rendering finds problems with the data a template is given, which the checker can’t always see ahead of time. Each rendering problem comes with its file and its place in the file. The page is still written, with nothing where the problem was:

Code When
unknown-pipe A pipe that doesn’t exist.
pipe-input A pipe given the wrong kind of value, like upper given a list.
pipe-argument A pipe given the wrong arguments, like money "NOPE" or divide 0.
missing-partial {{> name}} with no partials/name.html.
partial-recursion Partials using partials more than 32 deep.
loop-value-outside-each @index and the others outside an each.
unknown-loop-value An @ value that isn’t @index, @number, @first, @last or @count.
each-not-list each given something that isn’t a list.
unwritable-value A list or an item written as it is (a warning).
unsafe-url A link that isn’t safe, replaced with # (a warning).
script-output A value in <script>, <style> or an on… attribute without json.
output-in-tag A value between a tag’s attributes.
stray-fill A fill inside a partial’s own template, where there’s nothing for it to fill.
unused-fill A page fills a slot no layout has (a warning).
sample-body An item of a sample that isn’t one element.
missing-asset asset names a file that isn’t in assets/ (a warning).
unknown-form A form block for a form that isn’t in forms/.
form-input An input in a form block that doesn’t fit the form’s fields, or a required field with no input.

A pipe given an empty value gives back an empty value, without a problem, except default, the comparisons, includes and json, which are there to handle empty values.

The checker finds the rest, with the whole site in view: every template against the collections’ schemas, site.yaml, front matter, props and the pipes’ signatures. The checker also finds, before anything is built, the rendering problems above that don’t depend on the data: unknown pipes, pipes given the wrong kind of value or argument, missing partials and partials that use themselves, @ values, each given something that isn’t a list, values that can’t be written, and values in scripts, in tags, in fills and in samples. The problems in this table are the checker’s own:

Code When
invalid-yaml YAML that can’t be read, in front matter or a .yaml file.
invalid-schema A collection that doesn’t make sense: a field with no type, a list with no of, a choice with no options, a publish that isn’t a yes/no field. A key or option that does nothing is a warning.
unknown-type A field’s or prop’s type that doesn’t exist, like txt.
unknown-collection A reference, an item<…> or an item’s folder in content/ for a collection that doesn’t exist.
invalid-item A file in content/ that can’t be an item: in a folder of its own, not .md or .yaml, an id with other characters, a .md item in a collection with no body, or an item of a collection of pages.
missing-field An item without a field its collection says is required.
field-type An item’s value of the wrong type for its field, not one of a choice’s options, or an id written in the file.
broken-reference A reference to an item that doesn’t exist.
misplaced-key A front matter key where it does nothing, like props in a page, a typo of an optional key a layout reads, or a likely typo of a metadata key like descripton (a warning).
reserved-partial A partial in partials/ht/.
unsupported languages in site.yaml.
language-folder A folder in pages/ named like a language code (a warning).
unknown-name A name that isn’t there: not a block’s, a collection’s or one every template has. Also props in a page or a layout.
unknown-field A field that isn’t there, in an item, site.yaml, front matter or props, or given to a query pipe by name. Also a key in a collection page’s front matter that isn’t a field.
no-fields A field of something that has none, like menu.name (menu is a list) or item.name.first (name is text).
private-collection A template reading a private collection.
name-in-use An each name that’s a collection’s, one every template has, or one that already means something there.
missing-prop A required prop that isn’t given.
unknown-prop A prop the partial doesn’t take.
prop-type A prop given a value of the wrong type, like text where it takes html.
missing-front-matter Front matter a page’s layout needs that the page doesn’t have, or a required field of a collection of pages that its page doesn’t have.
front-matter-type Front matter of the wrong type for what the page’s layout reads, for a collection’s field, or for a metadata key like noindex.
missing-layout A layout that isn’t in layouts/.
layout-recursion Layouts that go round in a circle.
sample-position sample anywhere but at the end of an each’s list.
sample-loop-value @index or another @ value in the body of a sample.
no-item-page url of an item that no page renders, or a feed of items no page renders.
missing-each A page with a [field] in its name and no each, or with each and no [field].
route-field A [field] that isn’t a field of the items or can’t be in a URL, or brackets with no unique field among them.
head-managed A tag the engine writes into every page’s head, written by a template too: <title>, <meta charset>, the viewport, description, robots, OpenGraph and Twitter card tags, and the canonical, icon and manifest links.
unmanaged-embed An <iframe> written in a template by hand, which loads another site before a visitor agrees to it (a warning).
missing-alt An <img> with no alt (a warning, one of the search checks).
positive-tabindex A tabindex above 0 (a warning, one of the accessibility checks).
blocking-script A <script src> in the <head>, in a template or a snippet placed there, that isn’t async, defer or a module (a warning).
invalid-snippet A snippet without front matter, without consent, with a key snippets don’t have, or with a place, pages or consent that isn’t one of the values allowed; or a file in snippets/ that isn’t .html.
written-business A template’s own text, or its front matter, writes out the business’s phone number, an opening or closing time, a day it’s closed, or its street address, as site.yaml’s business has them, instead of reading them from site.business: it would go stale the day the owner changes them under Business (a warning).
missing-business site.yaml without business, or a business people visit without its address or phone (a warning, one of the search checks).
structured-data Hand-written structuredData without schema.org’s @context or a @type.
invalid-form A form’s file with a key forms don’t have, a collection that’s shown on the site, fields its collection doesn’t have or that a form can’t fill, a required field the form leaves out, or a replyTo, success, duplicates, forward or spamCheck that doesn’t make sense.
invalid-site site.yaml without its name or url, a key of the wrong type, or a likely typo of a key the engine reads (a warning).
invalid-redirect A redirect in redirects.yaml that doesn’t make sense: from a URL not starting with /, a * anywhere but at the end, a status that isn’t a redirect’s, or one to itself.

Building the site finds a few more, with every file in view, besides the search and accessibility checks of each page (see Search checks and Accessibility checks):

Code When
url-clash Two files at one URL: two pages, two items’ pages made from one template, or a page and a file in public/ or beside another page.
hidden-redirect A redirect from a URL that a page or file is at, so it never happens (a warning).
unknown-goal A goal in site.yaml’s analytics.goals that no page has a link, button or form for (a warning).
broken-link A redirect, or a link on a page, to a path on the site where there’s nothing, or a link to a place on one of its pages (#…) with no id for it (a warning).
reserved-asset A file of the site’s in assets/ht/, which is for the platform’s own.
reserved-url A file in public/ under /_forms/ or /_ht/, or a redirect from there, which are the platform’s own.
invalid-snippet A snippet listed for a path where there’s no page (a warning).
open-now-hours A page with ht/open-now, on a site with no business.hours to tell whether the business is open.
missing-asset An image, favicon or logo in front matter or site.yaml, an image prop, a picture in an item’s markdown, or a partial’s styles or scripts, names a file that isn’t in assets/ (a warning).
outside-picture A picture in an item’s markdown is on another site, so it isn’t made in sizes for each screen and is gone if that site takes it down (a warning).

The checker also works out which collections and fields each page reads, through its layouts and partials, so a build only remakes the pages a change can affect.

Grammar

template   = { text | escape | comment | verbatim | output | block | partial }
escape     = "\{{"                                    writes {{
comment    = "{{!" ... "}}" | "{{!--" ... "--}}"
verbatim   = "{{#verbatim}}" ... "{{/verbatim}}"           written as it is
output     = "{{" expr "}}" | "{{" "slot" [ string ] "}}"
block      = if | each | slot | fill | form
if         = "{{#if" cond "}}" template { "{{else if" cond "}}" template } [ "{{else}}" template ] "{{/if}}"
each       = "{{#each" expr "as" name "}}" template [ "{{else}}" template ] "{{/each}}"
slot       = "{{#slot" string "}}" template "{{/slot}}"
fill       = "{{#fill" string "}}" template "{{/fill}}"
form       = "{{#form" string { attribute "=" value } "}}" template "{{/form}}"
partial    = "{{>" partname { prop } "}}"
           | "{{#>" partname { prop } "}}" template "{{/" partname "}}"
prop       = name "=" value
expr       = value { "|" name { arg } }
arg        = value | name "=" value
cond       = and { "or" and }
and        = not { "and" not }
not        = "not" not | "(" cond ")" | expr
value      = path | string | number | "true" | "false" | "null" | "@" name | "(" expr ")" { "." name }
path       = name { "." name }
name       = letter or "_", then letters, digits or "_"
attribute  = a name that can also have "-", like aria-label
partname   = a path in partials/, like card or menu/item-card

and binds tighter than or, and not tighter than both: a or b and not c is a or (b and (not c)). Where a fill can go (inside a partial block, or at the top of a page with a layout) is decided by the checker, not the grammar.