Anything a site shows as a list, like a menu, a team, events or blog posts, is a collection: items that all have the same fields. Collections are what let the site’s owner keep the site up to date. The owner adds, edits and reorders items in the dashboard’s Content tab, in a form made from the collection’s schema, without touching a template.
A schema
Each collection is a YAML file in collections/, named for the collection. collections/events.yaml:
label: Events
fields:
title: { type: text, required: true }
slug: { type: slug, from: title }
date: { type: date, time: true, required: true }
photo: { type: image }
price: { type: number, min: 0, help: In dollars. Leave it empty for a free event. }
details: { type: markdown, required: true }
order: [date]
- Each field has a type: text, markdown, rich text, numbers, dates, yes or no, a choice of options, images, links, email addresses and phone numbers, slugs for addresses, references to another collection’s items, and lists and groups of fields. The reference has every type and its options.
labelandhelpare what the owner sees in the form. Writehelpfor the owner. The Code tab also shows it when the pointer is over the field.orderis the order items come in when a template doesn’t sort them:[date]is oldest first, and[-date]is newest first. A collection with apositionfield is instead in the order the owner drags its items into.
Every item also has an id, and gets created and updated times when it’s saved.
Items are files
Each item is a file in content/, and the file’s name is the item’s id: content/events/latte-art-class.yaml is the
event latte-art-class, with its fields as YAML. A collection whose items are mostly writing says which field is the
body, with body:. Its items are then .md files: the other fields as front matter, and the body below them.
Saving an item in the dashboard changes that item’s file in a commit of its own. The site’s history then shows each change separately, with who made it. Only the lines that changed are written, so comments and the order of the keys stay as they were.
Every item is checked against its schema, whoever wrote it. The checker finds a missing required field, a value of the wrong type, or a reference to an item that doesn’t exist, and reports each problem on the line it’s about.
In a template
A template reads a collection by its name. Pipes sort, filter and group its items:
<h2>Coming up</h2>
<ul>
{{#each events | where "date" gte=build.time | limit 3 as event}}
<li><a href="{{ event | url }}">{{ event.title }}</a>, {{ event.date | date "EEEE, MMMM d" }}</li>
{{/each}}
</ul>
Every pipe is in the reference, under Standard pipes.
A reference field, like artist: { type: reference, to: artists } on an album, is written in the album’s file as the
artist’s id. In a template it’s the artist itself, so album.artist.name needs no lookup. Since templates are typed, a
misspelled field is an error before anything is built, and so is a field used as the wrong type.
A page for each item
A page with a [field] in its file name is made once per item, with the brackets filled from that field: [slug] from
each item’s slug field, or [id] from its id. pages/events/[slug].html:
---
each: events as event
title: "{{ event.title }}"
description: "{{ event.details | plain | truncate 160 }}"
image: "{{ event.photo }}"
---
<h1>{{ event.title }}</h1>
{{ event.details | markdown }}
{{ event | url }}is the address of the event’s page. Use it in links anywhere on the site, and those links never break.- When an item’s slug changes, its old address redirects to its new one.
eachcan filter the items, likeeach: events | where "date" gte=build.time as event, and the file’s path can reach through references, likepages/music/[artist.slug]/[slug].html.
When an item is on the site
Every item can have showFrom and showUntil. Before its showFrom or after its showUntil, an item is left out of
its collection everywhere, and its page isn’t made. The site is built again automatically when each of those times
comes, so a seasonal drink or a holiday notice comes and goes without anyone publishing.
Collections that aren’t for pages
private: truekeeps a collection out of templates. A form fills a private collection: what visitors send is kept there, for the dashboard’s Inbox.publish: approvednames a yes-or-no field, and templates only see the items where that field is yes. It’s for what visitors send that an owner lets onto the site, like reviews.keep: 1 yeardeletes items once they’re older than a year, which suits what visitors send.
Pages as a collection
Some pages are written by hand, but are data too. Say each of a company’s apps has a page of its own, and the home page
lists the apps with their icons and release dates. A collection with pages takes those pages as its items.
collections/apps.yaml:
label: Apps
pages: apps/*/index.html
fields:
released: { type: date, required: true }
icon: { type: image, required: true }
order: [-released]
Every page that fits the pattern is an item, and its front matter holds the item’s fields.
pages/apps/timer/index.html:
---
title: Timer
description: An interval timer for workouts, with rounds and rests.
released: 2026-03-02
icon: apps/timer.png
---
<h1>{{ page.title }}</h1>
- The page’s front matter is checked against the schema, like any item, and the Content tab edits it in a form.
- Templates read the collection like any other:
{{#each apps as app}}. Each item has its page’stitle,descriptionandurlbeside its own fields, so{{ app.url }}links to the page. - The Content tab has a New button for the collection. What a new page starts as is in Skeletons.