Octopress 101

4 minute read

I decided to develop my own blog like all the other cool developers. If you got here, this is what I got so far, it’s not too much, but it’s a start.

When I develop something my rules are very simple

  • Avoid writing any code.
  • Keep it simple.
  • Easy to deploy on free hosting environment.
  • Decent code syntax highlight

So I heard(mostly in www) people talking about jekyll as a static web site generator and began to dig dipper, I searched a few ruby gems for blogging and found a gem called octopress. They, the guys who developed it, calls it Jekyll’s Ferrari, sounds good to me, looked pretty straight forward so I gave it a spin.

First thing you need to do it to create a new project for your blog (just a new folder)

mkdir my-blog

Next you should create a Gemfile for easy dependency management.

gem install bundler
bundle init

Now lets add octopress as a dependency, inside your Gemfile add

gem 'octopress', '~> 3.0'

Now we should tell bundle to install gems from Gemfile, in terminal run

bundle

Everything is set up, now according to octopress all we need to do is to run

octopress init <PATH>

and we have a blog ready.

Now you probably have a blog somewhere, mine is at blogger

And I thought to my self it would be nice to import all my posts to the new blog, well it’s super easy, jekyll has many importers read more about it here

So after 3 clicks and one script I got all my old posts on my new blog.

Whats next? Well I need some theme, cause I can’t design at all, I just know how to design code, when it comes to colors layout and fonts, I suck.

I googled a bit and found this and that and chose to start simple with minima, which is minimal and simple to install and work with

you just need to add it to your Gemfile

gem 'minima'

set the theme property in _config.yaml to minima and you are good to go, by running ‘jekyll build’ you’ll be able to see your blog site generated in the _site filder.

Now we just need to deploy it the easy way, this is where octopress helps. I use github pages, which is very simple to set up, you just need to create a github repo named:

.github.io'

then run

ocopress deploy init git <your full repo url>

now make sure you are not on master branch and run

JEKYLL_ENV=production jekyll build
JEKYLL_ENV=production octopress deploy

thats it you got your blog on jekyll published on git hub.

Refereces

Octopress
Jekyll
Minima
Github pages

Leave a Comment