1 About this article

2 The basic principles

2.1 What is jekyll and static site

Static site, as it's name, is delivered to the user exactly as stored. The dynamic part of the page, like comment, must be add as plugins. The advantage is that it's cheap and fast to develop, and easy to host. With generators like jekyll, you can build a site in seconds.

2.2 What is github pages

Github pages are public web pages freely hosted and easily published through github. There are two ways to set up a github page. First, you can create a repository called "username.github.io", where username is your username for github. Then this repository is your default git page repo. Push your site to master branch of this repo. You will see the site at https://username.github.io/ . Second, actually, every repository can be a git hub page by creating a branch called gh-pages. All the content on this branch, can be visit via https://username.github.io/project. For example, my blog repository https://github.com/terrylu87/terrylu87.github.io.git . So that you can visit my site by https://terrylu87.github.io.

2.3 The emacs and org-mode

3 Why emacs-jekyll-github-pages

I use emacs org-mode to write the blog. the org-mode provide a perfect way to compose logical oriented articles.

4 How to set up the blog

4.1 Set up your github pages

This wouldn't be a problem if you understand the basic principle describe in previous section. For me, I use the defautl username.github.io repository.

git clone https://username.github.io/terrylu87.github.io.git blog

4.2 Generate the static site

There are many tutorials online about how to generate a static blog. The document on the jekyll official website is good. But if you want a customized theme, or support the archive and tags and other feature. You need a better starting point. I use jekyll bootstrap : http://jekyllbootstrap.com/. The jekyll bootstrap support theme, which can easily be installed and changed.

git clone https://github.com/plusjade/jekyll-bootstrap.git jb

4.3 Test your site.

install ruby and JavaScript environment

sudo apt-get install nodejs ruby-dev

Install Jekyll

sudo gem install jekyll

Test the site

cd blog
jekyll serve

4.4 Push your site to github

cd blog/
cp -rf jb/* .
git commit
git push origin master

5 Other interesting stuff

5.1 Comments

I use disqus for comment. Register an account at disqus official site. They will provide some tutorials. But since our jekyll bootstrap had disqus integration. We just need change the \config.yml file under jekyll root dir.

comments :
    provider : disqus
    disqus :
      short_name : your_short_name

5.2 Theme and decoration

You can find a theme at http://themes.jekyllbootstrap.com/

cd blog/
rake theme:install git="https://github.com/jekyllbootstrap/theme-the-program.git"
rake theme:install name="THEME-NAME"

6 Todo

6.1 Add search function



blog comments powered by Disqus

Published

06 October 2014

Category

howto

Tags