chriswere.wales

PPB - Pandoc Page Builder

PPB is a simple static site generator that converts Markdown files into HTML pages using a Pandoc template. It is designed for small websites where each page is written in Markdown and rendered through a single HTML template.

The PPB script can be downloaded and viewed here.

Features

Requirements

Debian / Ubuntu

sudo apt install pandoc

Arch Linux

sudo pacman -S pandoc

Usage

Place your Markdown files and template in the same directory:

about.md
contact.md
index.md
template.html

Run:

ppb

PPB will generate:

about.html
contact.html
index.html

Template

PPB uses a standard Pandoc template.

At minimum, your template should contain the $body$ variable:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>$title$</title>
</head>
<body>

$body$

</body>
</html>

The $body$ variable is replaced by the HTML generated from the Markdown file.

Page Metadata

Pandoc metadata can be supplied at the top of a Markdown file.

Template variables such as $title$ can then be used inside template.html.

Example

about.md

# About

Welcome to my website.

- Simple
- Fast
- Static

template.html

<!doctype html>
<html>
<head>
    <title>$title$</title>
</head>
<body>

$body$

</body>
</html>

Output

Running:

ppb

creates about.html containing the rendered page wrapped in the template.

License

Public domain.