Who doesn’t like a little weekend project, right?
A combination of things has recently pushed me towards moving away from Wordpress — primarily the ever present threat of a high profile suite of software requiring constant upgrades to keep safe. Because of how rarely a I post (sometimes less often than Wordpress releases updates) I run a fairly high risk of having security holes in active code on my webserver. Between that and the fact that I simply don’t require such up-to-the-refresh dynamic flexibility (typically I only make layout changes once every 2 years or so) it just doesn’t make sense to use something so dynamic, thus I am ready to stop playing the upgrade game1.
Being that I keep exposed to new technologies, the Jekyll project has come across my path a few times. Between that and wanting to play around with the Phar format, I decided to have a go at the same concept written in PHP.
First, I looked around for some alternatives, and I did find one: Phrozn. However, while Phrozn is geared towards static site generation, it lacks some functionality unique to blogs: namely “tags” and chronological pagination.
So I figured, if the world could use one more PHP MVC framework2, then why not another static site generation script?
Thus, Alkemy was born.
Alkemy, like Jekyll, will take a list of posts, parse them up (Textile, Markdown, HTML, or just plaintext), smash them through some template files, and smoosh out a website. The website is fully generated and completely static. You serve nothing but set-in-stone HTML files and other non-code-interpreted content. This has 2 really big advantages:
- Damn if it isn’t fast — Static content requires no programming overhead; served direct from disk (or memory) to network pipe.
- Secure as all getout — there’s no php to hack, no python to work around, no perl to xss inject, no java stack traces, nothing interpreted but GET requests for static files.
Of course, one must eat his own dog food, so this blog is now managed by Alkemy. I have a local copy, versioning using Mercurial, where I get things written and tested. After I’m happy with my latest post, I commit locally, push to the server, and have the server run an update. My webserver has the repo’s “site” folder setup as the docroot and “TADA!” the site is updated.
You can find Alkemy at http://alkemy.info/ along with documentation and examples.
1 I have often wished Wordpress offered a LTS version of their software for this sole reason.
2 Not really.
UPDATE: Turns out static blogging like this kind of sucks. The overhead in producing the content, editing it in the right area, re-running the generation, and getting it synced up is too much of a burden. Compared to something like “Login, type, post” or even easier, bookmarklets (ala tumblr/posterous), it’s just no comparison. As such, this blog never even got off the ground with that code (not externally anyway) but instead is running some custom tumblresque software. Alkemy will stay released, in any case.