English
About this handbook

This handbook belongs to the Quartz plugin quartz-layout-box. And it is built with it: this box is a layout box.

It comes from a Markdown file, not from the configuration — which way is better when is in The snippet.

4.1 – Every placeholder

Placeholders sit in double curly braces and are replaced anew on every page. Spaces inside the braces are allowed: {{ title }} is the same as {{title}}.

PlaceholderValue
{{title}}the page’s title from the frontmatter
{{slug}}the page’s path, such as 3-placement/02-the-order
{{root}}relative way to the site root — . on the start page, ../.. two levels down
{{siteTitle}}configuration.pageTitle from the Quartz configuration
{{baseUrl}}configuration.baseUrl, may be empty
{{locale}}the page’s language: frontmatter field lang, else configuration.locale — en-US, say
{{lang}}only the front part of it: en
{{frontmatter.field}}any frontmatter field of the page

Values are escaped

An & in a page title becomes &amp;, angle brackets are made harmless. A placeholder therefore cannot smuggle in markup — not even when somebody writes <script> into a title.

Unknown names stay put

{{doesnotexist}} does not become an empty spot; it stays visible in the text. That is deliberate: a typo shows itself on first sight instead of quietly leaving a hole.

Anyone who needs curly braces as text switches the replacement off for that box:

options:
  placeholders: false

Frontmatter fields

{{frontmatter.<field>}} reads any field of the page. The chapter name in this site’s header is exactly that:

options:
  html: '<span data-section="{{frontmatter.section}}"></span>'
What the field holdsWhat gets inserted
text or a numberthe value
a listjoined with commas: a, b, c
an objectnothing — the placeholder stays
the field is missingnothing — the placeholder stays

Placeholders work in the title too

title: "About {{siteTitle}}" works. The plugin just does not escape there itself — the heading is a text node, which Preact escapes anyway.