Akash


Indian geek pythonista <3 vim & Linux.


Octopress and GitHub

Finally i managed to deploy Octopress on GitHub (pages) with custom theme. I added facebook profile link that wasn't provided by Octopress. Octopress is really easy,simple and beautiful.But I faced some problems while setting up Octopress.
So i thought of writing the first blog on "Deploying Octopress on GitHub".

I assumed you have installed RVM and Ruby on your machine.
My environment: RVM 1.17.3, Ruby 1.9.3p327, Ubuntu 11.10

Installing Octopress

```bash prepare workspace akash@desktop:$ mkdir github_pages #create your project directory akash@desktop:$ cd github_pages akash@desktop:$ git clone https://github.com/imathis/octopress.git octopress #clone octopress repo into octopress directory akash@desktop:$ bundle install # more about bundler http://gembundler.com/

Now install Octopress
```bash install Octopress
akash@desktop:$ rake install 

This command install Octopress default theme. You can install third party themes for octopress. List of third party themes

Deploying to GitHub

You must have a github repository with strict naming convention as username.github.com. After creating repository on GitHub, its time to configure rake for deploying blog. ```bash rake setup akash@desktop:$ rake setup_github_pages

This will ask you for github repository details. You have to follow the convention as

``git@github.com:username/username.github.com``
Note: do not add ".git" at the end.

```bash Check for remote repository
git remote -v 

#This was my output.
origin  git@github.com:akash0x53/akash0x53.github.com (fetch)
origin  git@github.com:akash0x53/akash0x53.github.com (push)

#If your output is
octopress   git://github.com/imathis/octopress.git (fetch)
octopress   git://github.com/imathis/octopress.git (push)

#then you need to add your repo using
akash@desktop:$ git add remote add origin git@github.com:username/username.github.com.git

To delete Octopress branch using ```bash Deleting remote branch akash@desktop:$ git remote rm Octopress

To publish pages on GitHub rename your branch to ``source`` branch
```bash rename branch
akash@desktop:$ git branch 
        * master
akash@desktop:$ git branch -m master source
akash@desktop:$ git branch
        * source

Now setup is complete. You can preview your blog using

    akash@desktop:$ rake preview

This command creates temporary server, listening on port 4000, goto browser and type localhost:4000. If you are satisfied with your work then do not wait to publish.

bash First push to GitHub akash@desktop:$ rake generate akash@desktop:$ git add . akash@desktop:$ git commit -m "some message" akash@desktop:$ git push origin source akash@desktop:$ rake deploy Wait for email from GitHub; as its your first push.

Congratulations you have successfully deployed your blog on GitHub.


About

Python Developer who hates WhatsApp and loves Open Source. Security enthusiast.
I believe "Talk is cheap, when it comes to coding".



Contacts