Flush static folder when rebuilding
fvsch opened this issue · 0 comments
Simpler option to avoid stale content when building is flushing and rebuilding.
This is alright IMO with Kirby because you should be running your site with PHP (and possibly Apache) when creating content and templates, and only generate the static export once you’re done. Worse case scenario is when debugging a problem in the export (e.g. your live version is alright but the static export is not), where you might need to export several times in a short time.
IMPORTANT: avoid erasing other files!
There was a previous effort by @noclat here: https://forum.getkirby.com/t/static-kirby-website-generator/21411 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 static).