0.6
Magazines
Pages that list their own children, siblings and grandchildren, parent references, and colour fields, found while building a magazine with editions.
Halftone, a magazine with numbered editions and articles inside each one, needed things a flat folder list couldn't do. Every addition below came from a page of that magazine.
Lists that follow the tree
{{ each:children }}lists the pages inside this one, such as the articles in an edition.{{ each:siblings }}lists the pages beside this one, such as the other articles in the same edition.{{ each:item }}inside an outer list goes one level deeper, such as the articles of each edition on the archive page. Lists nest two levels at most.skip-2leaves out the first two items, for "earlier editions" after the latest one.
{{ each:editions:newest:skip-1 }}
<h3>{{ item.title }}</h3>
{{ each:item:order }}<a href="{{ item.url }}">{{ item.headline }}</a>{{ /each }}
{{ /each }}
The page above
{{ parent.number }}shows a field of the page above, such as an article's edition. It works in references and in conditions, like{{ if:parent.cover }}.
Colour fields
- A
colorfield lets writers pick one of the site's colour tokens and renders its value. Set it as a CSS variable to theme one page: each edition of Halftone chooses its own ink.
<article style="--ink: {{ ink:color }}">