Search This Blog

Jan 2, 2014

Setup personal blog on Github page with Jekyll

1. Install Ruby 2.0.0
http://rubyforge.org/frs/download.php/76955/rubyinstaller-2.0.0-p195.exe
2. Install Ruby DevKit for Ruby 2.0.0
Download it fromhttp://rubyforge.org/frs/download.php/76805/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
Extract it to C:\devkit, enter the directory and execute below commands.
$ ruby dk.rb init 
to generate the config.yml file to be used later in this Step
$ ruby dk.rb install
This step installs (or updates) an operating_system.rb file into the relevant directory needed to implement a RubyGems
3. Add Taobao ruby in  gem mirror list. This is because GFW blocking.
$ gem sources --remove http://gemcutter.org/
$ gem sources --remove http://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
4. Install jekyll 
$ gem install github-pages
5. Clone Jekyll bootstrap
$ git clone https://github.com/plusjade/jekyll-bootstrap.gitUSERNAME.github.io
In USERNAME.github.io, open _config.yml file,  add 
markdown: redcarpet or markdown:  rdiscount under line pygments: true.
The reason is to support Github flavored markdown. 
6. Start Jekyll
cd USRERNAME.github.io
jekyll serve
We can see our first blog from http://localhost:4000
Press ctrl+c to exit local Jekyll.
Run 
Rake post title="Hello World"
And then we can see a .md file under directory _posts, excute Jekyll serve again, we can see the new post we have done. 
7. Push to Github
$ cd USERNAME.github.io
$ git remote set-url origin git@github.com:USERNAME/USERNAME.github.io.git
$ git push

Here is the new blog entry.
http://markding.github.io/

No comments: