0.8
The language grows
The template language grows up: else, comparisons, filters, tags and tag pages, pages of a list, repeaters, site fields, parts with values, feeds and sub-folder hosting.
Until now the template language did four things and stopped. Building real sites showed where that hurt: no way to say “otherwise”, no tags, no second page of a journal, a header copied into every template. This release fills those gaps, with tags that still read as plain HTML.
Conditions and lists
{{ else }}in conditions, and in lists for when there's nothing to show.- Conditions can ask for empty with
{{ if:!cover }}, and compare with{{ if:kind=essay }}and{{ if:kind!=essay }}. - Lists filter:
tagged-design,has-cover,no-cover,kind=essayandkind!=essay. - A new sort,
most, puts the most used tags first. - Any list can sit inside another, three deep.
{{ count:journal }}counts, with the same filters as a list.- References take formats: dates as
long,short,numeric,month,yearoriso, and text cut towords-25orchars-140.
{{ each:journal:has-cover:6 }}
<a href="{{ item.url }}">{{ item.title }}</a>
<time>{{ item.date:short }}</time>
{{ else }}
<p>Nothing here yet.</p>
{{ /each }}
Pages of a list
{{ each:journal:10:paged }}splits a list into pages:/journal/,/journal/page/2/and on.{{ paging.next }},paging.previous,paging.numberandpaging.totalmake the links between them.
Tags
- Any page can have tags, set in Page settings and kept in
page.json. {{ each:tags }}and{{ each:item.tags }}list a page's tags, each linking to its tag page.- A page with
"tags-of": "journal"becomes the list of that folder's tags, and Verso makes a page for each tag beneath it.{{ page.tag }},{{ each:tagged }}and{{ each:all-tags }}fill them in.
Repeaters, site fields and parts
- Repeaters:
{{ list:team }}…{{ /list }}is a list of items edited right on the page, each with fields of its own. - Site fields:
{{ site.footer:text }}is the same on every page, edited once, and kept incontent/site.json. - Parts:
{{ part:header }}brings inparts/header.html, so templates share HTML. Errors point at the part's own file and line. - Parts take values, so they work like components:
{{ part:card title=item.title label="Read more" }}, shown with{{ part.title }}and checked with{{ if:part.title }}.
Channels, feeds and hosting
- Channels: list a folder of posts in
verso.json, and the editor gets a panel to find, write, duplicate, draft and delete its posts. - Each channel gets an RSS feed at
/<folder>/feed.xmlonce the site has a"url", linked from its pages. "base": "/blog"builds a site that lives in a sub-folder.<html>carriesdata-basefor scripts.- The editor shows the numbered pages of a split list and every tag page, each with the editor of the page it comes from.
Fixes
- A
"pre code"key in the rich class map styles code blocks apart from inline code. - Pages are named by their title, without a “ — Site name” tail, instead of their folder.
- The editor stays above a site's sticky header.
- Images shown with
{{ item.cover }}bring their alt text. - An empty colour in a
styleattribute writesinitial, sovar()fallbacks work. {{ parent.parent }}explains that Verso only looks one level up, instead of showing nothing.- The editor serves
pages.json,sitemap.xmland feeds, so scripts that read them work while editing. - The editor recompiles CSS when a script in one of Elevate's
Watchfolders changes. - Bar buttons appear in the page menu on phones.
Elevate 1.3
- Attribute states:
@current,@expanded,@selected,@pressedand@openstyle an element by its ARIA or open state, so a script sets an attribute instead of swapping classes. font-numericsets tabular, oldstyle and other figures.- The
hiddenattribute always hides, even on an element with a display class likerow.
<a href="/docs/" class="text:ink-3 @current:[text:ink]">Docs</a>