Statac

A page in a template

What a template reads on a page: after page., or after any other name that stands for a page, such as post.title or page.next.url. A template reads a custom field the same way, such as page.isbn.

title

The page’s title: its title, or if it has none, the # heading its content opens with. If the page has neither, title has no value, so to show the name of any page, write headline(page).

Read more

url

The URL the page is published at, starting with /, such as /posts/post-1/. If the site’s url has a path, such as https://example.org/blog/, the URL starts with that path, /blog/.

Read more

slug

The last part of the page’s URL: post-1 for /posts/post-1/.

Read more

date

The page’s date, with its year, month, day and weekday. On its own, it shows in the site’s date format. If the page has no date, it has no value, and neither does a list’s paginated page.

Read more

updated

The page’s updated date. On its own, it shows in the site’s date format. If the page has no updated, it has no value, and neither does a list’s paginated page.

Read more

summary

The page’s summary, as the page writes it. If the page has none, summary has no value, and page.opening has the words of its first paragraph instead.

content

The page’s content, built into HTML. It is empty on a list’s paginated page. When another page shows it, such as a list or a feed, Statac writes its relative URLs in full.

Read more

excerpt

The start of the page’s content, built into HTML: everything before its <!--more--> line, or if it has none, its first paragraph. If the page has neither, excerpt has no value.

Read more

excerpt_marked

true if the page’s excerpt ends at a <!--more--> line, and false if it is the first paragraph.

Read more

opening

The words of the page’s first paragraph, as text with no markup. If the page has no paragraph, opening has no value.

word_count

The number of words in the page’s content, not counting code blocks and footnote markers. In Chinese and Japanese, each character counts as a word.

maths

true if the page’s content has maths in it, so a layout can add the maths stylesheet only where it is needed. It says nothing of the posts a page lists, so a template listing excerpts reads each post’s post.maths.

Read more

toc

The page’s headings, each with its title, id, url, level and the headings under it as headings. Empty if the page has no headings.

language

The page’s language as a code, such as en or fr, for <html lang>.

Read more

direction

Which way the page’s language runs: ltr, left to right, or rtl, right to left. For <html dir>.

Read more

translations

The same page in the site’s other languages, the main language first. Empty if there are none.

Read more

tags

The page’s tags, each a list with its name, url and posts. "Rust" in page.tags is true if the page has that tag, whatever capitals it is written with.

Read more

series

The series the page is in, as a list with its name, url and posts. If the page isn’t in a series, series has no value.

Read more

folder

The folder the page is in, as a list with its name, url and posts.

Read more

list

On a list page and each of its paginated pages, the list the page is for. On other pages, it has no value.

Read more

posts

On a list page, the posts this page of the list shows, in the list’s order. On other pages, it has no value.

Read more

number

On a list page, which page of the list this is, counting from 1. On other pages, it has no value.

Read more

previous

The page before this one in the list neighbours chooses. On a list page, it is the list’s page before this one. On the first page, it has no value.

Read more

next

The page after this one in the list neighbours chooses. On a list page, it is the list’s next page. On the last page, it has no value.

Read more

post

On a page made for each post by each: site.posts, the post it was made for.

Read more

key

On a page made by each: from an item in data/, the item’s name.

Read more

source

The file Statac read the page from, starting from the site’s folder: content/posts/post-1.md. A page Statac makes, such as a tag’s page, has no source.

og_title

The page’s title where it is shared, on a card and in a link preview: its og_title, or if it has none, headline(page).

Read more

card

The social card Statac draws for the page, or the social image its og_image names, with its url, width, height and alt. If the page has neither, card has no value.

Read more

webmentions

What other sites have said about the page: comments, the replies, mentions and bookmarks, and reactions, the likes and reposts. Both are empty if no one has said anything.

Read more

page.search_box() gives what a search box needs: id, the id for its element, first, whether it is the page’s first, and index, the URL of the search index for the page’s language. If a template reads index, the build publishes the index.

Read more

image

page.image("photo-1.jpg") gives an image beside the page, with src, width, height, alt and everything else an <img> for it needs. The call also takes sizes, full=true and decorative=true.

Read more

images

page.images(["photo-1.jpg", "photo-2.jpg"]) gives the images named, in that order, each with the same values as page.image. page.images() gives every JPEG, PNG and WebP beside a page that has a folder of its own, in file name order. It leaves out animated images and other kinds, such as GIFs and SVGs.

Read more

file

page.file("notes-1.pdf") gives any file beside the page, with url, name, size in bytes, text, code and language.

Read more

video

page.video("video-1.mp4") gives a video beside the page, with src and type.

Read more

audio

page.audio("recording-1.m4a") gives a recording beside the page, with src and type.

Read more

youtube

page.youtube(url), where url is a YouTube video’s URL or its id on its own, gives the video, with id, start, embed and thumbnail.

Read more

vimeo

page.vimeo(url), where url is a Vimeo video’s URL or its id on its own, gives the video, with id, start, embed and thumbnail.

Read more

untitled

true if the page’s untitled says it is meant to have no title.

Read more

draft

true if the page is a draft. Only statac serve builds drafts.

Read more

layout

The layout the page names, or the one cascaded to it, as its front matter writes it. If neither names one, layout has no value.

Read more

type

The page’s type, as the page writes it. If the page has no type, it has no value.

Read more

The page’s permalink, as the page writes it: a URL or a pattern. page.url is where the page is published.

Read more

redirect_from

The old URLs the page’s redirect_from lists, as the page writes them.

Read more

redirect_to

The URL the page’s redirect_to names, as the page writes it.

Read more

needs

url if the page’s front matter has needs: url.

Read more

translation_key

The page’s translation_key, as the page writes it.

Read more

neighbours

The page’s neighbours, as the page writes it: site, folder, series or false. If the page has none, it has no value.

Read more

each

On a page that makes pages, its each, as the page writes it: data.people or site.posts.

Read more

order

On a list page, its order, as the page writes it. page.list.order is the order the list runs in.

Read more

numbered

On a folder’s page, its numbered, as the page writes it.

Read more

posts_per_page

On a list page, its posts_per_page, as the page writes it. If the page doesn’t write one, it has no value.

Read more

index_page

On a list page, its index_page, as the page writes it.

Read more

feed

On a list page, its feed, as the page writes it: true, false, or the name or URL of a feed. page.list.feed is the URL of the list’s feed.

Read more

id

The post’s id in a feed, as the page writes it. feed_id(page) returns the id every post has, whether or not it writes one.

Read more

false if the page’s search leaves it out of the site’s search.

Read more

og_image

The page’s og_image, as the page writes it: the social image used in place of a card.

Read more

mentions

true if the page’s mentions asks for its webmentions to be shown.

Read more

Something unclear or wrong? Open an issue.