I’m going to make it a point to write about what I’ve learnt at least once a week.
It took a week to decide on using Jekyll and then styling/customizing my installation. I wanted to host it on Github pages but that didn’t support jekyll extensions, so right now this is hosted on Heroku.
So why Jekyll? Apart from being something completely new (thus, a learning opportunity), it was barebones. No database to worry about, no stuff I didn’t need baked into the core system. Just a simple static web server on top of a flat filesystem. Of course, if it was barebones, it was also lacking. The default installation doesn’t allow the use of haml/sass in templates. Jekyll Plugins allowed me to use haml for posts/pages, but not for templates. Fortunately, there was Jekyll Extensions. I had to modify an extension I found. I could have written a rake task to render the html templates from haml and thus skipped the whole need for the extensions system, but I wanted to take advantage of Jekyll’s auto-regeneration to see changes I made reflected live. What a headache that was.
The design for this blog is built using Compass & Susy, but the original extension only supported plain sass. For a static website, compiling sass (with Compass) to css would be a piece of cake using the command compass compile. Not so when I want to automate it. Calling the command using ruby from the extension triggered a file change, which triggered the auto-regeneration feature, which then called the extension again, and eventually would have caused the implosion of the universe had I not stopped it. After some Googling and a ton of debugging (including modifying the ruby sass engine temporarily), I finally got it to compile the sass using the Compass and Susy libraries. It’s not a very elegant solution, but it works.
Prior to this, I hadn’t ever touched haml/sass/ruby before, though I’d heard of their goodness. Haml and sass weren’t difficult to pick up, but I had to spend some time to wrap my head around ruby’s blocks/procs/lambdas and yield. Personally, I feel that ruby has a little too much magic applied to it. There are too many ways to go about doing one thing that you’re spoilt for choice. As someone new to the language, it was distressing to not know which was the better/best practice, as opposed to only having one (and thus the best) way.
Lastly, this was also a good opportunity to experiment with the capabilities of HTML5 and CSS3. Well, mostly CSS3. I’ve just one thing to say about it: Media queries are extremely powerful. Try resizing your browser.