Pages

Thursday, July 31, 2014

Use Jekyll to create a blog and host it on Github

Github is an attractive option for hosting a technical blog. The process is as simple as creating a repository, and adding index.html to it. Details can be looked up at https://pages.github.com/. Github uses Jekyll to generate the site. Jekyll is a simple, blog aware, static site generator. Using markup for the blog entries is one of the features of Jekyll. The installation can be done via gem ruby tool. http://jekyllrb.com/docs/quickstart/
Once installed, follow the following steps:
  • Clone the github page repository.
    git clone abc.github.io
  • Create a new file in the local git repository.
    touch Gemfile
  • Edit the file and put the following lines in it.
    source 'https://rubygems.org'
    gem 'github-pages'
  • Install Bundler http://bundler.io/
    gem install bundler
    bundle install
  • To run Jekyll with Bundler, issue the following command in the root repository.
    bundle exec jekyll serve
  • The site should now be available at:
    http://localhost:4000
More can be read about working with Jekyll at http://jekyllrb.com/docs/structure/. A very good example can be found at https://github.com/maciakl/Sample-Jekyll-Site/.

No comments:

Post a Comment