Article Image
read

There is a reason why octopress is called a blogging framework for hackers and that is because you have to love git and command line (it’s a good excuse to learn them!). You will be using these two a lot when building and growing your blog.

What is also useful to know, is that Octopress is built on top of Jekyll (which by the way is the technology used for GitHub pages), so as you get more advanced you might learn that too. But let’s leave that for another blog post.

Initial set up

First we need to clone octopress repository

1
$ git clone git@github.com:imathis/octopress.git my-blog

This is where our blog will live and my-blog directory should now contain:

git clone octopress

Then we need to install all dependencies (this might take a while…)

1
$ bundle install

if you got error message there, it means you dont have bundler installed so you need to install that too:

1
$ gem install bundler

Next, we need to install the classic theme

1
$ rake install

By now, our my-blog directory should look like this:

Classic theme

with 3 extra folders

  • public/ where generated static site lives (also, this is the only folder that is being pushed to github as we will see later)
  • sass/ where all the styling goes
  • source/ where contents of public/ are generated from

Last step is to generate public/ folder contents from source/ and boot-up a server at port 4000

1
$ rake preview

So if you go to http://localhost:4000 you should see your blog:

Blog is live

That’s it.

Configuring your blog

Configuring your blog is as simple as typing in

1
$ vim _config.yml

and changing contents of this file:

Configuring your blog

Creating content

This is the time to brush up on your basic markdown skills.

If you want to create a new post

1
$ rake new_post['My First Blog Post']

then cd source/_posts/ and you should find freshly created markdown file there (if you want to know how to use it, click on the link above)

if you want to create a new page

1
$ rake new_page['Projects']

and then if you want to decide where it is going to exist on your blog you need to

1
$ vim source/_includes/custom/navigation.html

If you want to create actual content for the page then

1
$ vim source/projects/index.markdown

Markdown is your friend when writing content for these pages.

Deploying/hosting your blog on github

First we need to create github repository for our blog, like this (replacing ‘username’ with your github username of course):

Creating new github repository

then

1
$ rake setup_github_pages

and copy paste the url that github gave you after you created repository.

Everytime you create new posts/pages, change anything on your blog and want to push those changes to github

1
$ rake generate

to generate public/ folder contents from source/ and then

1
$ rake deploy

to push everything to your newly created github repository.

Now, if you go to http://username.github.io you should see your blog live !

Image

Algoholic's Blog

It's not what you know, it's what you do with what little you know...

Back to Overview