Blogger to Octopress

Recently I shifted my blog from blogger to octopress. In this post I’ll try and cover the reasons for this shift, and the process followed.

Blogger world

It is ridiculously easy to set up your blog with blogger. Just a few clicks and your blog is up and running. Blogger also allows you to set up a custom domain without much hastle. And ofcourse with google backing it up, blogger has awesome support for SEO and analytics through google analytics.

Running into problems with blogger

Blogger is simple and fun to get started with, but whenever you want do something out of the line, like embed a piece of code in your blog, it becomes insanely difficult. Many of the folks who write blogs started from blogger and then moved on to more sophisticated platforms such as wordpress. For me, blogger was working fine but there were some really annoying issues. These are the primary ones:

  1. No markdown support
  2. Getting code in your blog could be ugly
  3. WYSIWG editor is a big fat lie
  4. Very limited templates - I had to write CSS for almost everything!
  5. Doesn’t have an hacker workflow - sublime, git, markdown, cli

Once I was fed up with blogger, I started searching for the next blogging platform. Wordpress was the first choice. With the wide variety of plugins and themes wordpress is really tempting, I even found a plugin for writing blogs in markdown with wordpress. Then I downloaded basic installtion of wordpress, and got it running with local wamp. Now the next big question was of deployment. I could setup an account on wordpress.com, but thats not something I wanted. Dependency on mysql for a blogging platform seemed far-fetched to me. Also, I ran into various issues while deploying wordpress to heroku: heroku supports only PostgreSQL. It’s a bit tricky to get wordpress up and running. I also tried DocPad, ghost and hexo. But couldn’t really relate to any of them.

Octopress

While working on github pages for one my open source projects, I wondered how github creates these pages from markdown ? I immediately started looking if they have put it open source. I realized github pages are powered by jekyll. jekyll is nice, but you need a layer of abstraction on top of this to be productive. Then after a bit of googling, I stubled upon octopress. Which runs on jekyll and is very easy to use. More importantly, it supports the workflow I was looking for!

Getting started with octopress

Octopress requires ruby for compiling your site into static HTML pages. I’m not ruby wizard, words like rake, nokogiri give me an headache. Octopress install page is fairly simple, and easy to understand. One should follow all those instructions piously. I’m serious, don’t miss out a single one, else you’ll be doomed with callstacks of ruby!

Gotcha: I installed ruby 2.0 x64 edition, on the site it says 1.9.3 or greater. But octopress just blew up when I tried compiling it on ruby 2.0. So a word of advice, stick with 1.9.3, don’t try to get fancy if you don’t know ruby.

Porting old blogs to octopress

First, you need to export the blogger information, it should give you an xml file. You should find this option in settings tab on the left side. this gist has the code for converting that ugly xml to octopress friendly blog files.

Gotcha: This gist requires a ruby gem nokogiri (ruby-gems is the package manager for ruby). To install nokogiri you have to run

gem install nokogiri
//If this doesn't work in your case try
rb gem install nokogiri --pre

I’m not sure what it does, but this worked for me!

Deploying to github pages and adding a custom domain

One of sweetest feature of octopress is no run time dependency. End output is just plain HTML, CSS, JS and could be deployed on any static file server. Github pages provide an excellent option, I already had a github account so I followed steps from this link.

Gotcha: Deploying to username.github.io will mess up your project pages. Deploy to gh-pages branch of a seperate repo in case you are using github pages.

Setting up a custom domain was easy once I figured out what to do. I deployed octopress to a seperate repository. So I had to add a CNAME file with my domain name in it, e.g

CNAME
chinmaymk.com

Then I had to edit the DNS entry for @ to 204.232.175.78 from my godaddy account. Note: It could take upto 48 hours to activate, in my case it kicked off within a couple of hours.

Adding disquss comments

Octopress does not have native support for comments, to get comments in your blog you have to setup an account with disquss. It will ask you a couple of questions such as what’s your domain name and site name etc. Finish those and in _config.yml add your disquss_short_name. Run rake generate and disquss comments should enabled.

Gotcha: There’s a flag in every post named comments: you have to set it to true.

And that was it! after a whole night dedicated to get this working, I finally had octopress up and running.