When someone makes a new file in the dashboard, the file doesn’t start empty. It starts as a skeleton: a starting point for new files in a folder. A new page then already has its layout and the parts the site expects, and the owner only fills in the content.
Where skeletons come from
A site keeps its own skeletons in skeletons/. Each skeleton is named for the folder it’s for, and has the extension of
the files it starts. A new file starts as the skeleton for its folder, or for the closest folder above that has one:
| Skeleton | A new file in |
|---|---|
skeletons/pages/apps.html |
pages/apps/ |
skeletons/pages.html |
pages/, or any folder in pages/ with no skeleton of its own |
skeletons/collections.yaml |
collections/: a new schema |
Nothing in skeletons/ is built, so a skeleton is never a page of the site.
When the site has no skeleton for a new file, the file starts as Hypertekt’s own skeleton for that kind of file: a page
with a title, a layout with slots for the head and the page, a schema with one field, a form, or a .gitignore that
leaves out .env and what tekt builds.
For owners’ pages
A collection of pages, like a page for each of a company’s apps, gets a New button in the Content tab. A new page starts as the skeleton for its folder, or for the closest folder above that has one. When no skeleton applies, the new page is a copy of the collection’s first page. The copy’s fields are emptied, and the rest of the front matter, like the layout, is kept.
A page’s skeleton can write the page’s fields into its HTML, so whatever the owner fills in shows on the page:
---
title: ""
summary: ""
---
<h1>{{ page.title }}</h1>
<p class="lede">{{ page.summary }}</p>
The values in the skeleton’s front matter fill in the new page’s form. A skeleton can use these values to give the owner a head start, such as the usual text for a button.