The advantage of using Jekyll is that:

  • use markdown syntax to release a blog post
  • render your blog at local side
  • git control

Steps

  • Follow the instruction in Github Pages, select to create Project site -> Start from scratch. Do not choose Generate a site, because it will offer you a web template and generate some web-related files that you do not need in Jekyll.

  • Install Jekyll

$ gem install jekyll
  • cd to your blog folder and initialize Jekyll.
$ cd myblog
$ jekyll new . --force
$ jekyll serve --detach
# => Now browse to http://localhost:4000
  • config the _config.yml file to fit your setting. For example, just add port: 8080 in the _config.yml, then it changes http://localhost:4000 to http://localhost:8080. See more configuration at Jekyll docs

  • command jekyll build whenever you do modification.

Notes

There are some inconvenient facts that Markdown is not rendering line spacing/block quotes properly with Jekyll. When you do want to insert a break tag using Markdown, you end a line with two or more spaces, then type return. Which, sadly, is a part of Markdown that Redcarpet doesn’t conform to. The workaround I use is adding <br /> where you want to break a single line.

After doing this, I found there is another way to make my static website. Since I am much familier with python, I was wondering if I should change to use Pelican instead of Jekyll. Anyway, I will let this to be a futher try.

Personal website powered by Bootstrap, Pelican, and GitHub Pages
Setting up a blog with Pelican and GitHub Pages

Reference

使用 GitHub Pages 和 Jekyll 來建立 Blog
Using Jekyll as a static site generator with GitHub Pages
how to configure website menu in jekyll