Creating a GitHub Pages Blog With Octopress on Ubuntu

Creating a GitHub Pages Blog With Octopress on Ubuntu

GitHub Pages are public webpages freely hosted and easily published through our site. You can publish online using the Automatic Page Generator. If you prefer to work locally you can use the GitHub for Mac and Windows apps, or the command line.

Pages are served over HTTP, not HTTPs. That doesn't make them inherently less secure, but, it does mean that you shouldn't transact any sensitive information with them (like passwords or credit card numbers).

GitHub Official Website github.org

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 Official Website octopress.org

Install Required Package

1 Install Git

$ sudo apt-get update && sudo apt-get install git

2 Install Ruby 1.9.3 via your OS package management or rbenv or RVM.

$ curl -L https://get.rvm.io | bash -s stable --ruby
$ source /home/username/.rvm/scripts/rvm

If using package management may need to install ruby-dev
Check your Ruby version is at least 1.9.3 and install bundler:

$ ruby --version
$ sudo gem install bundler

Initial Setup

Clone the octopress repository and set it up

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

We're going to use Github pages. Octopress has some rake tasks to make this easier for you. Your blog will be hosted at http://<username>.github.io and you need to create a new Github repository called username.github.io that github pages will use the master branch as the html source for your blog.

$ rake setup_github_pages

This rake points our clone to the new repistory we just set up, configures your blog’s URL and sets up a master branch in the _deploy directory for deployment.
Totice the blog's URL does not include the end of the .git, it should be like this username.github.io
edit _config.yml and fill in your blog name and other details. There’s also some configs for twitter/G+/etc plugins that are worth configuring.

Generate and preview the blog

$ rake generate
$ rake preview

This will generate the contents of your blog and allow you to preview it at [http://localhost:4000].

Creating a GitHub Pages Blog With Octopress on Ubuntu

Once you’re happy with the contents we can deploy your blog for the first time.

$ rake deploy

This will copy the generated files into _deploy/, add them to git, commit and push them up to the master branch. In a few seconds you should get an email from Github telling you that your commit has been received and will be published on your site. Being your first commit it could take 10 minutes for the blog to be available at [http://username.github.com]
Don’t forget to commit your changes to the source branch:

$ git add .
$ git commit -m 'After install'
$ git push origin source

Finish
Now, you have your site running on Github with Octopress.

5.00 avg. rating (98% score) - 3 votes