Jekyll 非你莫属

30 Nov 2011

Jekyll is a simple, blog aware, static site generator. It takes a template directory (representing the raw form of a website), runs it through Textile or Markdown and Liquid converters, and spits out a complete, static website suitable for serving with Apache or your favorite web server. This is also the engine behind GitHub Pages, which you can use to host your project’s page or blog right here from GitHub.

安装 Jekyll

下面详细说明一下在Windows环境下安装Jekyll~~Linux系统下的直接看教程就好了

Step1

首先你需要有一个Windows下的Linux模拟环境,可以安装Cygwin,或者使用MsysGit。

Jekyll是用Ruby编写的。最好的安装方式是通过RubyGems:

1  
2 $ gem install jekyll

在Windows无法直接安装RubyGems,因为Cygwin等客户端不能使用make, gcc, sh来进行编译。教程上给出If you encounter errors like Failed to build gem native extension on Windows you may need to install RubyInstaller DevKit

DevKit 是windows平台下编译和使用本地C/C++扩展包的工具。它就是用来模拟Linux平台下的make, gcc, sh来进行编译。但是这个方法目前仅支持通过RubyInstaller安装的Ruby。

Step2

下载最新的RubyInstaller(我使用的是rubyinstaller-1.9.3-p0.exe),安装

下载最新的DevKit(我使用的是DevKit-tdm-32-4.5.2-20110712-1620-sfx.exe),安装

Step3

在模拟环境Cygwin或者MsysGit中:

1  
2 $ gem install jekyll

安装会附带自动安装所需要的 directory_watcher, liquid, open4, maruku and classifier

Step4

测试一下是否安装成功,在Cygwin或者MsysGit中输入:

1   
2 $ jekyll --version
3 Jekyll 0.11.0

若要在本地测试完再上传,可以在文件根目录下执行:jekyll —server —auto,会在根目录下生成_site文件夹,然后访问 http://localhost:4000 即可~..~

更多请参考博文:

>>Jekyll in Windows 终极奥义
>>Jekyll 本地调试之若干问题

Fork me on GitHub