01月5日, 2015
1. Jekyll介绍
Jekyll是一个静态站点生成器,它会根据网页源码生成静态文件。它提供了模板、变量、插件等功能,可以用来生成整个网站。
Jekyll生成的站点,可以直接发布到github上面,这样我们就有了一个免费的,无限流量的,有人维护的属于我们的自己的web网站。Jekyll是基于Ruby的程序,可以通过gem来下载安装。
Jekyll官方文档:http://jekyllrb.com/
2. 安装Ruby
Install Ruby Get Ruby for Windows
下载Ruby http://rubyinstaller.org/downloads/
make sure to check the “Add Ruby executables to your PATH” box.
安装Ruby,再安装
Install the Ruby DevKit
Get the Ruby DevKit
The download is a self-extracting archive. When you execute the file, it’ll ask you for a destination for the files. Enter a path that has no spaces in it. We recommend something simple, like C:\RubyDevKit\. Click Extract and wait until the process is finished.
Next, you need to initialize the DevKit and bind it to your Ruby installation. Open your favorite command line tool and navigate to the folder you extracted the DevKit into.
cd C:\RubyDevKit
Auto-detect Ruby installations and add them to a configuration file for the next step.
ruby dk.rb init
Install the DevKit, binding it to your Ruby installation.
ruby dk.rb install
~ D:\workspace\ruby>gem update –system
3. 安装Jekyll
~ D:\workspace\ruby>gem install jekyll
Install a Syntax Highlighter
gem install rouge
Then, in your _config.yml, set Rouge as your syntax highlighter:
highlighter: rouge
http://jekyll-windows.juthilo.com/3-syntax-highlighting/
gem install jekyll
ruby源替换成taobao的源
$ gem sources –remove http://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org
# 请确保只有 ruby.taobao.org