Learn how to create a Github blog in this short Octopress tutorial.
If you are not into coding then I recommend that you build a WordPress website.
Summary To Create a Github Blog
- Install Octopress
- Setup Github Pages
- Add remote repository
- Review git branches
- Preview on development
- Deploy to Github
- Create posts in development and deploy
- Add a custom domain
Ruby 1.9.2p320. MAC OSX 10.9. Vim. iTerm2
- Install Ruby, git
- Have a github account
- Basic knowledge of git and github
- Confidence about the command line
- Get a domain if you want to add a custom domain
Installation Process of Octopress
Go to the terminal and clone the Octopress repo:
git clone git://github.com/imathis/octopress.git octopress cd octopress bundle install
This command installs Octopress
Deploying to Github
Create a new Github repository. If you are creating a personal blog create a repo called:
After creating the repo, run the following command.
Which is supposed to:
- init a git repo
- rename the branch from master to source
- add your repo to origin.
Running the previous command shows this:
Enter the read/write url for your repository
You have to enter it like this:
For me it didn’t rename the branch from master to source or add my remote repo. I did it manually (see below)
Add your remote repo
Check what remote repositories you have:
git remote -v
My output was:
octopress git://github.com/imathis/octopress.git (fetch) octopress git://github.com/imathis/octopress.git (push)
To add your repo do:
git remote add origin firstname.lastname@example.org:username/username.github.com.git
Rename the branch from master to source
$git branch * master $git branch -m master source $git branch * source
Preview on development stage
$ rake preview
Then browse to:
If you get this error:
Sorry, I cannot find /
Read this link: Deploying to a Subdirectory
First push to Github
$rake generate $git add . $git commit -am "First deploy to github." $git push origin source $rake deploy
Create a new posting
$rake new_post["Creating a Github Blog Using Octopress"]
Go to the app folder
source/_posts to find the new posting
Edit the posting and then follow these steps
$rake generate $git add . $git commit -m "Initial blog post." $git push origin source $rake deploy
Add a custom domain
Go to source folder:
Create 2 files
Open the CNAMe file and add this line:
The NoJekyll file will make Octopress works in Github Pages.
Push again to github
rake generate git add . git add -am 'domain configuration' git push origin source rake deploy
Github needs time to read your CNAME and updating the sites.
Quick Summary for creating and deploying a post in Octopress
$ rake new_post["New Post"] $ rake generate $ git add . $ git commit -am "Some comment here." $ git push origin source $ rake deploy
Disclaimer about this Website
This is not an Octopress website. This is a WordPress website.
I used Octopress for a few years.
The problem with Octopress is that I wanted more customization and didn’t have time for what I wanted to do. Instead I decided to move to WordPress because…(almost) everything is done and you just plug and play.
The best things about an Octopress website are:
- You write on Vim…the best editor in the Universe.
- It renders static pages. There is no DB. So it loads ultra fast
Recommendations for a Github Blog
- Create a private repository in Github
- Get your domain at DNSimple