For a work project I need to export a site as static HTML files (+ page files and assets). I have more requirements than what @bastianallgeier’s statify.php script does so I started building a plugin that should ultimately do a bit more.
The first bits are at https://github.com/fvsch/kirby-staticbuilder and it’s very early work, right now it doesn’t copy files (images, PDF etc.) or assets. It’s working for a single page and the action for exporting all pages worked in my case (files are generated) but didn’t show the intended HTML response (Apache and/or PHP gave up at some point).
Update: currently requires Kirby 2.3 (beta). It should be easy enough to make it work on 2.2 but by the time the plugin would be stable then 2.3 will be stable too. ^^
There was a previous effort by @noclat here: Static Kirby website generator but the repo is gone, perhaps because it had nuked some pour soul’s system. I’ll try to find a way to prevent that, e.g. enforcing that the output folder (which will be emptied when rebuilding the full site, I don’t intend to do incremental stuff and diffing) has a specific, unchangeable name (like
static: you can configure the path to put it anywhere, but the folder itself must me named
It’s very early work so any feedback would be appreciated: feature requests, ideas to improve the code or behavior, etc. And as it is right now, I would suggest that you only try running it if you can read and understand the code.