Build Jekyll Website from Scratch on Windows

When I decided to open my own website with some basic functions, such as blogging, hosting GitHub projects, Jekyll comes as a natural choice to serve as a static site generator with GitHub pages. However, the sad thing is that I didn’t have any knowledge of web development, hosting that time and my first Jekyll effort is basically a fork of GitHub project Jekyll Now. But working on a project in GitHub directly lacks testing, control and monitoring which pushes me further to dig into Jekyll.

Once opening account through GitHub, each account is allowed to have one site hosted directly from GitHub repositories which is called ‘GitHub Pages’. Please go to this site (GitHub Pages) for details.

Jekyll is a simple, blog-aware, static site generator. It uses static html pages so there is no extra requirement to database which makes the loads quite fast. Also, Jekyll is the engine behind GitHub Pages which means people could host sites right from GitHub repositories. Combining them together, it gives people ways of creating sites with fast blogging and project sharing with such benefits: 1). local edit; 2). control testing by running Jekyll; 3). pushing through Git.

After checking the official website of Jekyll, I notice that Windows is not official supported (see: http://jekyllrb.com/docs/windows/). Plus, I have no idea of Ruby. I decide to learn how to set up Jekyll on Windows and record the necessary steps based on my experience as follows.

2. Install Ruby and the Ruby DevKit

Since Jekyll is written by Ruby, you will need to install Ruby and corresponding Ruby DevKit which is a toolkit that makes it easy to build and use native C/C++ extensions such as RDiscount and RedCloth for Ruby on Windows.

(2a). Install Ruby and DevKit
Go to this site to install Ruby first. Currently, the latest version of Ruby is 2.3.1.

Jekyll has a built-in feature to allow us to keep track of changes. In Windows, you need to install Gem ‘wdm’ to enable this function. Also, suggested by GitHub Pages, Ruby uses the contents of your Gemfile to track site’s dependencies and versions. Here is the content of Gemfile of this test site:

Sometimes, people will use GitHub to manage projects by different repositories. And if you want to include each individual project into your GitHub Pages, you can simply change your _config.yml of baseurl and url as follows: