Reference

Page block

All 13 keys of the page block in the front matter of a template, and the tags a header or footer can hold.

On this page

Community

The page: block in the front matter of a template sets the page size, the margins, the header and the footer. A key that is not in the table fails with Unknown key '<name>' in page block. The Page layout guide explains how to use it.

Keys

Write margin.top as margin: {top: 20mm}. The same goes for the other keys with a dot.

Key Value Does
size A CSS page size: A4, Letter, A4 landscape, 210mm 297mm The page size.
margin.top A CSS length: 20mm, 1in The top margin.
margin.right A CSS length The right margin.
margin.bottom A CSS length The bottom margin.
margin.left A CSS length The left margin.
header.first Text, or none The text of the top-center box on page 1. none clears all three top boxes on page 1.
header.rest Text The text of the top-center box. header.first replaces it on page 1. header.center writes the same box and wins when both are set.
header.left Text Text in the top-left box. header.first: none clears it on page 1.
header.center Text Text in the top-center box. header.first: none clears it on page 1.
header.right Text Text in the top-right box. header.first: none clears it on page 1.
footer.left Text Text in the bottom-left box on every page.
footer.center Text Text in the bottom-center box on every page.
footer.right Text Text in the bottom-right box on every page.
Tag Prints
{{ page }} The number of the current page, starting at 1.
{{ pages }} The number of pages.
{{ section }} The title of the first heading on the page marked class="section-title" or data-brevier-section. A page without such a heading shows the title from the pages before.
{{ path }} A value from the data, such as {{ company.name }}. If the data has no such field, the text stays as written.

Write the three counters as {{ page }}, {{ pages }} and {{ section }}, with or without the spaces inside the braces.

Example

page:
  size: A4
  margin: {top: 45mm, right: 20mm, bottom: 30mm, left: 25mm}
  header:
    first: none
    rest: "{{ section }} · Invoice {{ invoice.number }}"
  footer:
    center: "Page {{ page }} of {{ pages }}"