Original post is here: eklausmeier.goip.de
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 all in the Jamstack overview.
- mkws: a minimalist static site generator, written in 31 lines of sh and 400 lines of C
- Saaze: an easy to use generator which is able to generate static or dynamic sites, written in PHP/Symfony
- Franklin: easy embedding of math and Julia notebooks, written in Julia, mentioned in Jamstack
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 is:
1for t in "$srcdir"/*.upphtml
2do
3 echo "Making $(basename "${t%.upphtml}".html)"
4 pp "$sharedir"/l.upphtml "$t" "$1" > \
5 "$(basename "${t%.upphtml}".html)"
6done
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:
1saaze/
2├── build/
3├── cache/
4├── content/
5│ ├── pages/
6│ | └── example-page.md
7│ └── pages.yml
8├── public/
9│ └── index.php
10└── templates/
11 ├── collection.blade.php
12 ├── entry.blade.php
13 ├── error.blade.php
14 └── layout.blade.php
The "build" directory will contain all HTML files, if one generates entirely static pages with the command
1php 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.,
1---
2title: An Example Post
3date: "2020-10-13"
4---
5This 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 website is generated by Franklin.
The directory structure of Franklin is:
1.
2├── _assets/
3├── _layout/
4├── _libs/
5├── __site
6│ ├── index.html
7│ ├── folder
8│ │ └── subpage
9│ │ └── index.html
10│ └── page
11│ └── index.html
12├── config.md
13├── index.md
14├── folder
15│ └── subpage.md
16└── page.md
The "__site" directory and its corresponding sub-folders are created by running
1newsite("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.