HaXtatic: Haskell-based Static Site Generator

A bit late to post this, but since late 2016 I worked on-and-off on my Static Site Generator in Haskell. The pitch:

static site generator focusing on: opionated templating language ➜ powerful out-of-box building blocks ➜ composable no-nonsense-time-saver features ➜ dead-simple extensibility (for Haskell hackers) ➜ detailed & ~99% complete docs


HaXtatic performs "incremental"/"differential" rebuilds by default, so just changing a single content-source file will only re-generate that (or with a Blok page, the entire Blok). Changing a template causes rebuilding of every file (by default from a cached pre-processed version) utilizing that template. Changing *.haxproj or *.haxsnip.html files causes a "full" rebuild (also invalidating/overwriting all cached files).

On my machine (mid-2014 Thinkpad, Windows 8.1 64bit), HaXtatic consistently reports for a full rebuild (assuming no static-files have changed, and with page-caching disabled — it's enabled by default) of this very documentation site:

Wrote 35 files in 0.42s:
    0.03s pre-templating & planning
    0.29s page templating & generation (30x ~0.009s)
    0.09s XML file generation (5x ~0.018s)
    0s misc. & file-copying

With page-caching enabled (the default), per-page cost is about halved (for "differential" rebuilds as per above). Another example, a full rebuild of the publicly visible parts of metaleap.net (no static-file changes) routinely gives:

Wrote 21 files in 0.46s:
    0.05s pre-templating & planning
    0.36s page templating & generation (19x ~0.019s)
    0.04s XML file generation (2x ~0.022s)
    0s misc. & file-copying

In this case, enabled page-caching only improves per-page cost to ~0.013s so the gain very much depends on the overall project, content characteristics, main-template complexity/functionality and such; of course there will always be in principle some slight gain for all subsequent differential rebuilds.

So from the above and some other experimental/test sites, on my machine/architecture/OS combination, I can consistently expect "about 40-50 files generated per second". Not "stellar" but certainly mighty fine for the intended uses. Differential rebuilds of course cut down the total number of files to re-generate.