7th March 2021

Lesser Known Static Site Generators

Well known static site generators are Hugo (written in Go), Pelican (written in Python), Grav (written in PHP), or Eleventy (written in JavaScript). For a list of static site generators see Jamstack (322 generators listed) or Static Site Generators (460 generators listed).

The following three static site generators unfortunately are not listed in before given Jamstack overview.

  1. mkws: a minimalist static site generator, written in 31 lines of sh and 400 lines of C
  2. Saaze: an easy to use generator which is able to generate static or dynamic sites, written in PHP/Symfony
  3. Franklin: easy embedding of math and Julia notebooks, written in Julia

To better understand what makes above list stand out against the more popular ones: Hugo's daily use is a little bit cumbersome and every release of Hugo gets more complex, additions to the Hugo source code are unwelcome.

1. mkws was covered in mkws - Static Site Generation With The Shell. The main loop in the 31 lines of shell code are:

for t in "$srcdir"/*.upphtml
do
        echo "Making $(basename "${t%.upphtml}".html)"
        pp "$sharedir"/l.upphtml "$t" "$1" > \
                "$(basename "${t%.upphtml}".html)"
done

I.e., read files with suffix upphtml and run them through the simple pre-processor program pp. pp is like php, but way simpler, although not necessarily faster. pp pumps everything between #! lines through a shell.

Posts in mkws have to be written in HTML, unless you add another helper program to the equation. mkws is to be considered a proof-of-concept.

2. Saaze has been written by Gilbert Pellegrom, who also wrote PicoCMS. Directory layout of Saaze is as below:

saaze/
├── build/
├── cache/
├── content/
│   ├── pages/
│   |   └── example-page.md
│   └── pages.yml
├── public/
│   └── index.php
└── templates/
    ├── collection.blade.php
    ├── entry.blade.php
    ├── error.blade.php
    └── layout.blade.php

The "build" directory will contain all HTML files, if one generates entirely static pages with the command

php saaze build

The "public" directory is used, if instead, you want your pages fully dynamic, i.e., with possible PHP code embedded.

The "templates" directory is used for templates, which are based on Laravel Blade.

Posts in Saaze are written in Markdown, and each post is prepended with a short Yaml frontmatter header, e.g.,

--- 
title: An Example Post
date: "2020-10-13"
--- 
This is an **example** with some _markdown_ formatting.

Posts in Saaze are called "entries". These called "entries" are collected together in what Saaze calls "collection".

Saaze can be extended to match ones own Markdown tags. This is described in Extending Saaze.

3. Franklin is used for the entire Julia documentation and shines at mathematics. It was written by Thibaut Lienart. For example, the Julia web-site is generated by Franklin.

The directory structure of Franklin is:

.
├── _assets/
├── _layout/
├── _libs/
├── __site
│     ├── index.html
│     ├── folder
│     │   └── subpage
│     │       └── index.html
│     └── page
│     └── index.html
├── config.md
├── index.md
├── folder
│   └── subpage.md
└── page.md

The "__site" directory and its corresponding sub-folders are created by running

newsite("TestWebsite"; template="vela")

from within the Julia REPL. The "__site" directory is then to become the web-root of your web-presence.

From the three generators, Franklin is obviously the most powerful one. It has good integration to site-search using lunr.js, with math, with source code, even live Julia code, or plots.

Each post in Franklin is a plain Markdown file.




Categories: Web
Tags: SSG
Author: Elmar Klausmeier