Joe Jenne

Static Site Generator

simple and flexible templating method using pp

I have written a static site generator named ppages. At its most basic, it is a shell script that loops through HTML template files in a directory, inserting preprocessed and compiled markdown.

Template files are named *.template.html and may look like the following:

<head>
...
</head>
!!  pp < $INPUT_FILE | cmark
<footer>
...
</footer>

A template named blog.template.html is the "blog" template and will be used for markdown files named like <page-name>.blog.md. When ppages is run, each template in turn is processed for each matching markdown file - setting INPUT_FILE=<path to md file>.

So with the following files:

> ls site/
blog.template.html p.template.html index.p.md other.p.md blog/index.blog.md

you would generate the following pages:

/index       # Using "p" template
/other       # Using "p" template
/blog/index  # Using "blog" template

Check out the github repo to download and for more details: https://github.com/jhjn/ppages