You can build your blog on your own github project repository using Octopress. Here’s the instruction how to set it up. While you’d find most of the things there, there’s a thing you need to take care of if you intend to get it done with your project pages (gh-pages) rather than with the user pages (<username>.github.io).
Clone the Octopress and install dependencies
(Ruby >1.9.3 required)
1 2 3 4 |
|
Install a theme
1
|
|
Check here if you want to find some additional themes instead of the default one.
Deploy to github project pages
1
|
|
You’ll be asked for the url of the github repository. Just enter https://github.com/<username>/<project>.git
(If you’d tried deploying to your <username>.github.io
, the following two steps would have NOT been required.)
Add remote origin
1 2 |
|
Correct things manually
Open _config.yml
. You might see the string /github
for the properties url
, subscribe_rss
, root
, destination
. E.g. url: http://<username>.github.io//github
.
Change them to the project name of your actual repository. Here’s mine (for https://github.com/jungkees/log.git
):
1 2 3 4 |
|
Open config.rb
and do the same (/github
to /<project>
).
I got this after changing them:
1 2 3 4 |
|
Open Rakefile
and change public_dir = "public/github"
to public_dir = "public/<project>"
.
Before you go to the next step, find the directory public/github
and change it to public/<project>
. Now it seems you are ready to generate the blog.
Generate and deploy
Run these commands:
1 2 |
|
The generate command creates the blog at public/<project>
and deploy command move the blog to _deploy
directory and push the content to github. (gh-pages
branch is used automatically.)
Push the source code
Lastly, push the entire blog assets to github. With the project pages, the branch is master
by default. Thus, it will be like:
1 2 3 |
|
Alright. You’ve done it. Here’s the Octopress tutorial for the blog posts. Enjoy your posting in beautiful markdown!