Building a custom blog engine.

In my previous post (here) I talked about some of the requirements I had for a blogging engine. The general requirements boil down to just a couple of things. The blog must be easy to maintain and it shouldn't get in my way when trying to display complex examples.

What exists

Since I'm not really a huge fan of writing software that already exists I did some searching to see if anyone else had run into these issues. In my search I came across jeykll which is a blogging framework built on ruby. It fits my requirements almost perfectly, except for one major issue. I need a back end to build examples on. Often times my examples will have ajax based components, and I need a simple way to write code in a backend that can handle those requirements.

Full development stack

Towards that end I've decided to blog using Yesod. This is a full web stack for developing in the Haskell programming language and has some really nice features going for it. From a simple to use, basic ORM. To full on templating languages for html, javascript, coffeescript, and easier to use css. It really is the bees knees for haskell web development. Not only that, but it's ridiculously fast comapred to the alternatives.

Simplifying the process

To make it easier to publish blog posts I've blatantly ripped off some ideas from jeykll. Most notably the idea of YAML Front Matter. Each post is a single html file with a yaml header followed by normal html. For example the header of this posts HTML file looks like this:

    ---
        date: 04/08/2012
        url: blog-engine
        title: New Blog Engine
        tags: [blog]
    ---

Git to the rescue.

Now that I have my post file format I can move on to other issues. How do I backup and deploy at once? Luckily this is a solved problem; since we're using nothing but flat files we can use git for both source control management and publishing.

Free hosting on Heroku

Since I am already using git for source control and mostly serving flat files I can simply do a:

    git push heroku deploy:master

and we are live! Heroku gives out one free small instance per site so I don't even need to pay anything for hosting my blog; and if I need more resources, Heroku can automatically give me more with a few clicks of a button.

There is still a lot to do to make this really workable. I need to add paging, a commenting system (heard of DISQUS?), and an RSS feed. These are pretty minor to implement so they should be coming shortly. If you have any questions just reach out to me on my contact page and I'll get back to you.