Set Up a Blog With an HTML5 Template in Octopress and Heroku Cloud Service

Environment

  • Ruby 1.9.2p320
  • Rails 3.2.3
  • MAC OSX 10.7.3
  • Editing with TextMate
  • iterm2

References

Octopress documentation

I posted an article about setting up a blog using Octopress and deploying it to Github pages here.

This article explains how to set up a blog with Octopress, which uses an HTML5 template and how to deploy it to Heroku

Warning This article assumes you already installed RVM and Ruby.

For more information about installing Ruby and RVM go here

Follow the same steps to setup Octopress

$ git clone git://github.com/imathis/octopress.git octopress
$ cd octopress
$ bundle install
$ rake install

Follow this to deploy to Heroku

As seen on the Octopress documentation

Install the heroku gem

You can verify if you have the heroku gem by running this:

$ gem list

Otherwise run:

$ gem install heroku

Create an app in Heroku

$ heroku create

Set heroku as the default remote to push

$ git config branch.master.remote heroku

Edit the .gitignore file

Remove the line that says public

Configure the blog

Open the project directory and open the file _config.yml. Edit the fields as required. It has some defaults that you can change.

Preview on local development

$ rake preview

Create a post

$ rake new_post["A new post"]

Go to the app folder source/_posts to find the new posting. Add content to your posting.

Push to heroku

$ rake generate
$ git add .
$ git commit -am "Deployed to heroku"
$ git push heroku master

Custom domain with Heroku

Source: Custom Domains with heroku

$ heroku domains:add www.example.com

Add a CNAME to the DNS settings pointing to yourappname.herokuapp.com