Using octopress we can setup a blog very easy , the most import is that the blog is host at github:
- it is free!
- version control !
- without bandwith limit !
- without storage space limit!
- keep as long as you wish !
Let’s go …
Step1: setup your project on github.
second ,you need create a new repository with your name , assume your github account name is yourname , you need create your project with the name yourname.github.io or yourname.github.com .
Step2: Setup Octopress
assume you are working on uinx or linux, you alredy have git installed.
run the following command from terminal to get rvm:
install ruby 1.9.3 or later 1:
1 2 3
get octopress from github:
1 2 3
install the default theme:
if you met some error when using
rake install, please try
bundle exec rake install2 .
Step3: deploy to github pages
this command will do a couple things for you:
- Ask you for your github pages repository url.
- Rename the remote pointing to imathis/octopress from ‘origin’ to ‘octopress’
- Add your Github Pages repository as the default origin remote.
- Switch the active branch from master to source.
- Configure your blog’s url according to your repository.
- Set up a master branch for your project in the _deploy directory, ready for deployment.
this will generate the content of your blog under _deploy directory and push it to master(gh-pages) branch , a few minites later, you can view your blog at yourname.github.io(com)
Step4: Configure Octopress
open _config.yml, change the config as you like:
1 2 3 4 5
then, it will generate a file source/_post/YYYY-MM-DD-XXXX.markdown , this is the blog source , you can edit it with markdown , if you havn’t familiar with markdown , refer markdown wiki or markdown in Chinese
Step6: Generate & Preview
after finish one post , you can preview it:
1 2 3
open browser http://localhost:4000 you can see your blog.
Do not forget two things :
- Commit sources of your blog to github , from your local source branch to source branch in github.
1 2 3
- Deploy your blog, this will generate all files under_deploy and commit it to github master(gh-pages) branch.
Finally , you will get a similar blog as current stevevallay.github.io
the first octopress plugin i recommanded is backtick code block , it can help add line number and syntax hightlight, octopress default installed it under plugin directory. Simple you can use it as following:
``` [language] [title] [url] [line text] code snipt ```
``` bash $ sudo make me a sandwich ```
Disqus is a blog comment hosting service for websites and online communities that uses a networked platform.
Octopress already have support for Disqus, to add
Disqus comments to your Octopress:
- You need Sign up an account of
Disqusif you do not have one.
- Register your site to Disqus, input
Site ShortName(remember this , it is used in step 3).
- Modify the
_config.ymlunder your octopress directory as following (add your
Site ShortNameand set
1 2 3