Octopress - An awesome blogging framework

Page content

I’ve been looking to re-launch my blog recently and be a bit more active in contributing to the community. While doing so, I wanted to change my existing blogging platform as well as hosting.

Looking For a Light-Weight Blogging Platform

When I fist started blogging, I went for the Orchard Project as the blogging platform. I was hoping that it would be light, MVC-based platform that would be easy to manage and maintain. I was a bit dissapointed with Orchard - it was pretty heavy, development was cumbersome, the performance was low and overall felt like a bit of an overkill.

Looking at a new framework, I had several requirements. It had to be fast, simple and be able to handle

  • posts
  • archive & monthly archive
  • widgets to load latest & custom
  • ability to generate custom content pages

I also wanted move away from an IIS based hosting over to Nginx. That meant I had few open-source CMS options to look at. There is Django CMS, Joomla and of course Drupal.

And then I stumbled upon Octopress

Octopress

Unlike the traditional CMS projects, octopress is a blog-aware static content site generator. It runs on top of Jekyll which is the engine behind GitHub pages.

The content is generated from the markdown files you create. Jekyll alone does not have a great deal of html templates and css/js - that’s where Octopress comes in. It gives you an awesome framework that you can take forward and tweak to your liking, directly in the code.

The fact that all the content is static makes your site super-fast - as demonstrated in the graph below.

Time to download the pages

Living with Octopress

Having used Octopress for few weeks now, the experience has been great. The ability to change html/css directly is great as well as no need to have data-store in place. The deployment is simple and straightforwards as well as backups. In short, exactly what I a was after.

Installation

Installing Octopress is super-easy. The two main dependencies are Ruby and Git, which most devs will have anyway.

1git clone git://github.com/imathis/octopress.git octopress
2cd octopress

You will then need to install couple of other gem dependencies and install octopress - to setup dirs and structure

1gem install bundler
2rbenv rehash    # If you use rbenv, rehash to be able to run the bundle command
3bundle install
4
5rake install

Octopress has a concept of templates/layouts and includes which you can include to avoid repetition. You can find them in /source/_layouts and /source/_includes

Writing Posts

Once you have Octopress up and running, you can start creating posts. There are rake methods to do that as a shortcut.

To create a new post, run

1rake new_post["A new post Title"]

This will create a new markdown file in /source/_posts. Each post contains a set of variables and the actual content. You can also add your own on top of the pre-defined.

 1---
 2layout: post
 3title: "SASS with Visual Studio Part 1 Introduction"
 4date: 2011-09-11 15:01:30 +0000
 5comments: true
 6categories: [SASS, CSS, Visual Studio]
 7customVariable: "Custom content"
 8image: /images/posts/sass/sass_thumb.jpg
 9---
10
11This is a start of the content ...

Once you’re happy with the content, you can run another rake task to produce the content.

1rake generate

The generated files will end up in /public

Hacking Octopress

Octopress is an ideal choice for any developer. In fact, there was very little that it couldn’t do out of the box or I couldn’t change right away.

It was super easy to change any html and tweak any shared components. There are lots of plugins available, the only additional bit that I was interested was a monthly archive which I borrowed from here.

Back ups

One of the nicest things about Octopress is the ease of back-ups. With no dependencies on DBs or any other storage, I tend to simply push the entire blog onto a public github account.

That means I have a permanent backup and I can clone and start updating the content anywhere. Changing hosting providers is a matter of minutes rather than hours.

Deployment

All that octopress needs is an http server in front. It supports a simple push to something like GitHub pages or Rsync to your own server. You can also easily write your own rake tasks to push the content anywhere.

Any questions, give me a shout @mirajavora