Use Jekyll to build a static HTML web site
Build site steps
- Download Ruby with DEVKIT
- Install rubyinstaller-devkit-2.5.1-2-x64 with default settings except:
- Open cmd console and enter the following command:
gem install jekyll
- Install a syntax highlighter. You can install the Ruby-based Rouge or the Python-based Pygments. The difference is Rouge suppports less languages then Pygments. If you like Rouge, you can enter the following command:
gem install rouge
- I like Pygments. I need to install Python 2.7 first. Then I can install the tool with:
python -m pip install Pygments
- Jekyll has a cool feature. It will monitor the site folder for changes and rebuild the site. Install it with:
gem install wdm
- Install bundler.
gem install jekyll bundler
- Generate a site.
jekyll new my_site
- Change directory to the site folder. Then install all dependency package. Building the site with:
cd my_site bundle install jekyll build
- Now I can start my web site. And go to the URL http://127.0.0.1:4000/ to see my home page.
jekyll serve -w
Troubleshooting
When I generate site, I got an “Could not load Bundler. Bundle install skipped.” error.
C:\Users\user_name>jekyll new my_site
Could not load Bundler. Bundle install skipped.
New jekyll site installed in C:/Users/user_name/my_site.
I have to install bundler. It will work OK
gem install jekyll bundler
When I build the site, I got an “in `block in verify_gemfile_dependencies_are_found!’: Could not find gem ‘minima” error.
gem install minima
Then I try to fire command jekyll build
again. I got another error message “Could not find gem ‘tzinfo-data x64-mingw32’ in any of the gem sources listed in your Gemfile”. Try the following command to fix it.
bundle install