Bradley Grainger home

How to use GitHub Pages on Windows

Install

  1. Install RubyInstaller. (I used version 1.9.2-p290.)
  2. Install the RubyInstaller DevKit (be sure to customise the install path, e.g., to C:\RubyDevKit).
  3. Install Jekyll: Run "Start Command Prompt with Ruby", then gem install jekyll
  4. Install Python. (I used Python 2.7.2 Windows Installer.)
  5. Install Python setuptools. (I used setuptools-0.6c11.win32-py2.7.)
  6. Add C:\Python27\Scripts to your path.
  7. Install pygments: easy_install pygments
  8. Apply the patch (linked here) to prevent "Liquid error: bad file descriptor" being output when you use pygments: cd /c/Ruby192/lib/ruby/gems/1.9.1/gems/albino-1.3.3/lib; patch < 0001-albino-windows-refactor.patch

Set up the GitHub Pages Repository

  1. Install msysGit.
  2. Create a new repo as per the GitHub Pages documentation.
  3. Write and save a post in the _posts folder.

Test

  1. Run "Start Command Prompt with Ruby" and change to your pages repo's working copy.
  2. Enter jekyll --auto --server to build your site and launch a web server that rebuilds your site every time you save in your editor.
  3. Browse to http://localhost:4000 to see your site.

Publish

  1. Create a GitHub repository named after your user name (e.g., bgrainger.github.com).
  2. Push your local repository to GitHub.

Further Reading