Page Structure
Static pages consist of two parts: Front Matter and Content.
Front Matter
Front Matter is a YAML block placed at the top of a Markdown file. It serves as a list of metadata properties.
We borrowed the concept of Front Matter from Jekyll. However, contrary to Jekyll, Resonance validates all the Front Matter, and you can only use a predefined set of fields specific to Resonance.
For example:
yaml--- layout: dm:document title: Example Document description: This document is about... ---
Supported Fields
Field | Type | Description |
---|---|---|
layout |
string |
Learn more about Providing Layouts on it's documentation page. |
title |
string |
Used in < tag and when referencing this page from other pages. |
description |
string |
Used in < tag and when previewing this page from other pages. |
collections (optional) |
array< |
Assign this page to a collection. Collection names can be arbitrary. Resonance supports " and " collections.next is used to organize the items order, it tells which other page should follow this one. It does not mean that the next page is immediately next after this one - just that it should be somewhere after this one in the given collection. |
content_type (optional) |
" or " |
If it's set to " then the page content is not parsed, it's forwarded to the layout as-is. |
draft (optional) |
bool |
If set to true, this page will be ignored by static page generator as if it doesn't exist. |
next (optional) |
page- |
Tells the generator which page is immediately next to this one (if it's a part of a series for example). It should follow the same logic as with < .In documentation pages it's used to generate previous / next links in a footer. |
parent (optional) |
page- |
Tells the generator which page is higher in hierarchy of documents than this one. In documentation it's used to generate menus with nested elements. |
register_stylesheets (optional) |
array< |
You can add extra stylesheets to this page. It follows the Asset Bundling (esbuild) rules. It's also used to generate < tags, so you might want to keep stylesheets fine-grained to avoid unnecessary preloads. |
Page Basename
page-
is a string
that references another page. The static page
generator validates it and then raises an error if the referenced page does not
exist or if it's a draft.
Page basename is a relative path to that page without an extension.
For example, let's consider a project like this:
pages/
├─ features/
│ ├─ feature_foo.md
│ ├─ feature_bar.md
├─ homepage.md
If pages/
is the base directory, then feature_foo.md
has a page-
path equal to features/feature_foo
, homepage.md
has a basename of
homepage
, etc.
Content
Depending on what content_type
the page has ("
or "
), you
can use either of those.
"
is not parsed by the static page generator
at all (just passed to the layout), so we are going to focus on Markdown
instead.
Using "
content type does not mean that the entire layout is replaced
with the given code - just the contents.
The chosen layout decides where to put the static page contents.