A First Blog Post: Tribute to Octopress

Johan Attali bio photo By Johan Attali

As a Software Developer, it is now kind of trendy to maintain a blog where you can share a few gits or titbits of code with the community.

Fortunatly, there are many tools out there to ease the process of creating a blog. And when you don't know html5 that well and are not very good with CSS either, some of these tools will make your life easier.

The new trendy tool that I found during my research and that I decided to use for my blog is octopress.

Setup

For a basic setup (ie no database connection), the installation is very easy and if your a Mac user, it can be summarized into the following steps:

  1. Install ruby 1.9.3
  2. Fork octopress
  3. Configure your blog
  4. Start blogging

Once your setup is done and you have your first post created, you simply have to generate the blog and preview it.

rake generate
rake preview

The preview command will start a webserver listenning on localhost:4000, it really is THAT simple.

Once you're happy with the result and depending on your hosting deployment choice simply run

rake deploy

and you're done.

Working with images

Dealing with resources is always a bit tricky, especially when you have to deploy the website.

However octopress makes very easy, all folders you can add your source/images repository can be accessed, you just have to specify the url path. Here for the octopress image I simply wrote <img src="/images/posts/octopress.png" /></a>.

Just make sure to put the absolute path so that the image is accesible from everywhere.

Finding your favorite theme

There are many themes available for octopress, opthemes gives a good overview of the best looking ones.

I personnally chose a slighly modified version of cleanpress with the defauly syntax theme set to solarized instead of the one shipped, that I found a little too gray.

Installation is pretty smooth:

cd octopress
git clone https://github.com/apouche/cleanpress.git .themes/cleanpress
rake install['cleanpress']
rake generate

Issues between rake and zsh

There is a known issue when using rake for example to create a post or install a template :

> rake install['cleanpress']
sh: no matches found: install[cleanpress]

To solve this, simply add alias rake='noglob rake' into your .zshrc file.