Jekyll

Category: /knowledge /front_end
Tags: front_end

Installation

New installation instruction @ github.com

Mac

gem install jekyll
gem install gihub-pages

Ubuntu

Ubuntu 14.04 has Ruby 1.9.x which makes gem and Jekyll installation much easier.

Install ruby, nodejs and jekyll:

  sudo apt-get install ruby ruby-dev make gcc nodejs
  sudo gem install jekyll --no-rdoc --no-ri
  sudo gem install github-pages --no-rdoc --no-ri

If you see ‘zlib missing’ error message, need to install zlib

  sudo aptitude install zlib1g-dev 

Check installed version:

$ jekyll -v
jekyll 2.5.3

Stack Overflow has instruction to install Ruby 2.0+.

Ubuntu 12.04

Ubuntu 12.04 comes with Ruby 1.8.x which is kind of old for Jekyll 2.5 on github pages. The installation requires extra workaround steps.

Basic operations

Create a new site

jekyll new your-new-site
cd your-new-site

Site generation

jekyll build 
or 
jekyll b

If you see bundle error messages, try bundle exec jekyll b.

Start a local server to check,

jekyll serve
or 
bundle exec jekyll s

# add this line in .bashrd to save typing
alias jk='bundle exec jekyll serve --watch --port 8000'

Then in the site folder, run jk, open a browser at http://localhost:8000

讨论

提示

  • 如果看不到讨论部分, 请暂时关掉adblock in Firefox/Chrome
  • 本网站使用Javascript实现评论功能, 此处外链对提高您的网站PR没有帮助. (潜台词: 请不要灌水, 谢谢)