I'm a contributor to the Sculpin open source project. Sculpin is a PHP-based static site generator that helps you create blogs or informational websites. Posts and pages can be written in Markdown or HTML, and it uses the Twig template library to provide enhanced functionality. The best part is, the resulting output is static - it can be hosted on any HTTP server, including AWS Simple Storage Service (S3), without having to worry about maintaining databases or other headaches.
When users create sites in Sculpin, they often use it in --watch
mode. In this mode, Sculpin runs as a simple PHP server that watches the filesystem for any changes to your blog posts, pages, and templates. When it detects a change, it regenerates the affected HTML files. It's not speedy enough in this mode to serve the site to the Internet - plus, it only has a single process - but it's great for development and local testing.
Earlier this week, a bug was reported on Sculpin's develop
branch, where the watch process wasn't properly applying changes to inherited templates. I had to go to some creative lengths to solve it, and while I'm not entirely certain that my proposed solution is the proper one, it contains at least one thing worth blogging about.