Page numbersΒΆ
Number pages, and repeat the website's name and the current section at the top of each page.
plugins:
- exporter:
formats:
pdf:
stylesheets:
- pdf.css
header:
left: "{site_name}"
right: "{section}"
footer:
right: "Page {page} of {pages}"
@page {
size: A4;
margin: 2.5cm 2cm;
@top-left {
color: #3949ab;
font-weight: 600;
border-bottom: 1px solid #c5cae9;
}
@top-right {
color: #3949ab;
border-bottom: 1px solid #c5cae9;
}
}
headerandfooterplace text in the margins of every page, at theleft,centerorright. Their placeholders are replaced by the website's name ({site_name}), the heading the page starts with ({section}), the page number ({page}) and the number of pages ({pages}).- The stylesheet sets the size of pages and their margins, leaving room for the header and the footer.
- Headers and footers are page margin boxes: the stylesheet styles them with
@top-leftand@top-rightrules, which win over the plugin's own (each box needs a rule of its own).
To number pages without anything else, a footer is enough:
plugins:
- exporter:
formats:
pdf:
footer:
center: "{page} / {pages}"
