For your AI and the curious
Pages, layouts and partials
How a page file becomes a web page. The frontmatter fields, which layout a page gets, what a partial can see, and the variables.
On this page
A page file holds two things: frontmatter, and the content that goes inside <main>. A layout wraps the content, partials supply the shared pieces, and SiteShip writes the document and its <head>.
This page is the architecture topic of the connector's guide tool, in more detail than How a SiteShip site is put together.
A page is frontmatter plus main
---
title: Teeth Whitening
description: Whitening in one visit, from $299. Book online.
image: /assets/images/whitening.jpg
---
<section class="py-20">
<h1 class="text-4xl font-bold">Teeth Whitening</h1>
<p>Call {{ site.phone }} to book.</p>
</section>
- The file's place is its address:
pages/about.htmlis/about,pages/services/index.htmlis/services. - A page never has
<html>,<head>,<body>, a header or a footer. A page that does is refused (author.page_has_document_shell). - A page is
.htmlor.md. Liquid works in both. In a Markdown page, Liquid inside a code block or inline code prints as written. - Markdown is turned into HTML before Liquid runs. So a Liquid loop in a Markdown page cannot produce a Markdown list. Write the list as HTML:
<ul>{% for s in data.services %}<li>{{ s.name }}</li>{% endfor %}</ul>
Frontmatter is YAML
A colon inside an unquoted value is a YAML error, and the file is refused (author.frontmatter_yaml_invalid). Quote such values. Also quote a value that starts with {, [, *, &, @ or #.
title: "Services: What We Do"
Frontmatter fields
Every field is optional.
| Field | Type | What it does |
|---|---|---|
title |
string | The page title. Used in <title>, the share title, breadcrumbs and feeds. Leave the site name out; SiteShip adds it. |
description |
string | The meta description, share description and search snippet. |
image |
string | The share image. Falls back to defaultImage in data/site.yaml. |
layout |
string | A layout under templates/, without the extension. |
robots |
string | The robots meta tag, for example noindex. |
date |
string | ISO date the content was written. Sorts a collection and feeds the RSS feed. Never hides a page. |
publishDate |
string | ISO date the page goes live. Hidden from listings, the feed and the sitemap until then. |
draft |
boolean | true keeps the page off the site until removed. |
modified |
string | ISO date of the last real change. Used as <lastmod> in the sitemap. |
tags |
string or list | Tag pages and related posts. |
keywords |
string or list | Extra words site search finds the page by. Not written into the page. |
type |
string | A schema hint. type: faq writes FAQPage schema from data/faq.json. |
scripts |
string or list | Script addresses to load on this page (https://… or /assets/js/…). |
route |
object | Makes a page per item of a data list. See Data files and generated pages. |
perPage |
number | Items per page on a paginated listing. |
collection |
string | Treat this page as the listing for another collection folder. |
item_template |
string | A partial used to render each item on a listing. |
sort_by, order |
string | Listing sort field and direction (asc or desc). The default is date, newest first. |
limit, offset |
number | The most items a listing shows, and how many to skip. |
where |
object or list | Keep only the listing items whose fields match. |
Two more, by behaviour:
search: falsekeeps a page out of site search and leaves it in the sitemap.access:,members_only:andmemberTier:are refused (author.membership_unsupported). There are no members-only pages.
Your own fields are allowed and read as page.yourfield. An unknown key that is close to a known field is reported as author.frontmatter_typo.
Layout overrides
Every page uses templates/layout.html. A layout starts at <body> and puts {{ content }} where the page goes:
<body class="bg-white text-secondary-900 min-h-screen flex flex-col">
{% render 'header' %}
<main id="main-content" class="flex-1">
{{ content }}
</main>
{% render 'footer' %}
</body>
SiteShip writes everything above <body>. A hand-written <!DOCTYPE>, <html>, <head>, <title>, meta tag, canonical link or stylesheet link in a layout or partial is dropped and reported (author.engine_head_tag).
Three optional overrides. The first match wins, and each one also starts at <body>:
| Page | Layout used |
|---|---|
Markdown files in pages/<dir>/ |
templates/<dir>/single.html |
pages/<dir>/index.html |
templates/<dir>/archive.html. Tag pages use templates/<dir>/tag.html. |
layout: name in the frontmatter |
templates/name.html |
A layout with no {{ content }} is reported (author.layout_missing_content_slot). A layout: that names a missing file is refused (author.layout_missing).
There is no {% extends %} and no block inheritance.
Extra head tags
templates/components/head.html holds extra head tags only: a font <link>, a verification <meta>, a third-party head script. SiteShip puts it into the head itself, so the layout does not render it.
Partials and what they see
Shared pieces are partials in templates/components/. Render one by its bare name, never its path:
{% render 'header' %}
{% render 'service-card', service: s %}
A partial always sees these, with nothing passed:
| Variable | What |
|---|---|
site |
data/site.yaml |
data |
Every data/*.json list |
page |
The current page's frontmatter |
item, params |
On a generated page: its data entry and the address parts |
currentPath, canonicalUrl, year |
The current address, its full form, and the year |
Anything else is passed as an argument, as service: s is above. A loop variable from the page is not visible inside a partial unless you pass it.
Markup that repeats, such as a card or a call-to-action band, belongs in a partial rendered in a loop. A {% render %} of a partial that does not exist is refused (author.component_missing).
Variables
| Variable | Where | What |
|---|---|---|
site |
Everywhere | site.name, site.phone, site.menu, site.address.city, and any field you add |
data.x |
Everywhere | data/x.json. A hyphen works: data.practice-areas |
page |
Everywhere | This page's frontmatter |
content |
Layouts | The rendered page |
item, params |
Generated pages | The data entry, and the address parts |
posts, pagination, collection |
Listing pages | The collection's pages, and paging |
currentPath, canonicalUrl, year |
Everywhere | For active menu links, share links and the copyright line |
breadcrumbs, toc |
Posts and deep pages | The trail to this page, and its headings |
readingTime, relatedPosts, prevPost, nextPost, shareLinks |
Posts | Reading time, related and neighbouring posts, share links |
toc comes from a Markdown page's headings. An HTML page has none.
Liquid, briefly
{{ site.name }}
{{ page.title | default: site.name }}
{{ post.date | date: "%B %d, %Y" }}
{% if site.phone %}…{% elsif site.email %}…{% else %}…{% endif %}
{% assign featured = data.services | where: "featured", true | limit: 3 %}
{% assign total = price | times: qty %}
- It is
elsif, notelseiforelse if. - There are no operators inside
{{ }}. Use the filtersplus,minus,timesanddivided_by. - Filters are the standard Liquid set plus
where,group_by,limit,markdownifyandjson. An unknown filter is reported (author.unknown_filter). where: "field", valuekeeps the items whose field equals the value. When the field holds a list, it matches if the list contains the value.
A phone link strips the punctuation:
<a href="tel:{{ site.phone | remove: ' ' | remove: '(' | remove: ')' | remove: '-' }}">{{ site.phone }}</a>
Related pages
Something wrong on this page? Email support@siteship.ai. Checked on November 14, 2026.