Start Blogging With Octopress

| Comments

i’ve been hearing a lot of Octopress so i decided to give it a shot, i like the idea behind this blogging framework, baked HTML pages instead of a PHP/MySQL, writing post in markdown format and many more so don’t be surprised if the next time you visit this site has an Octopress look and feel.

What it’s Octopress

Octopress is a framework designed by Brandon Mathis for Jekyll, the blog aware static site generator powering Github Pages. To start blogging with Jekyll, you have to write your own HTML templates, CSS, Javascripts and set up your configuration. But with Octopress All of that is already taken care of. Simply clone or fork Octopress, install dependencies and the theme, and you’re set.

Octopress Setup (in Mac)

You’ll need to install Git and set up your Ruby environment. Octopress requires Ruby 1.9.2 wich you can easily install with RVM, If you don’t have RVM yet, Install RVM and then install Ruby 1.9.2.

rvm install 1.9.2 && rvm use 1.9.2

Setup Octopress

git clone git://github.com/imathis/octopress.git octopress
cd octopress    # If you use RVM, You'll be asked if you trust the .rvmrc file (say yes).
ruby --version  # Should report Ruby 1.9.2

If ruby –version doesn’t say you’re using Ruby 1.9.2, you may want to revisit your RVM installation.

Next, install dependencies.

gem install bundler
rbenv rehash    # If you use rbenv, rehash to be able to run the bundle command
bundle install

Install the default Octopress theme.

rake install

Start blogging with Octopress

Octopress offers some rake tasks to create post and pages preloaded with metadata and according to Jekyll’s naming conventions, to create a new blog post run the following:

rake new_post["Hello Octopress"]
# Creates source/_posts/2012-01-30-Hello-Octopress.markdown

now open the newly created file and repleace the contents with this:

---
layout: post
title: "Hello Octopress"
date: 2012-01-30 11:10
comments: true
categories: General
---
**Hello Octopress!**
This an example post for more information see:

Preview your content

run the following:

rake generate   # Generates posts and pages into the public directory
rake watch      # Watches source/ and sass/ for changes and regenerates
rake preview    # Watches, and mounts a webserver at http://localhost:4000

Preview your content with Powder

We are going to use Powder (that manages Pow) to preview our content, it’s really simple to install and use, just a few commands and you are ready to go.

first we need to install Powder

gem install powder

next we install pow server with powder

$ powder install
=> Installs pow server

next we link the octropress folder with pow

$ powder link
=> Link the current dir to ~/.pow/<current_directory>

Now that you’re setup with Pow, you’ll just run rake watch and load up http://octopress.dev.

Currently i’m in the migrating from WordPress state, i don’t want to loose my current pemalinks and i still figuring out what is best for deployment Github Pages or Heroku.

please don’t forget to visit octopress documenation for more info about it.

Cheers!

Comments