There is a more recent version of this post which covers ruby 1.9.3, python 2.7.3.
This is quick guide to setting up Octopress on a Windows 7 machine to publish to GitHub pages. It relies on ruby 1.9.2 and python 2.7.2.
Get with GitHub
First, get an account on GitHub and follow the excellent instructions for Windows here. here.
Once you are set up with GitHub, get yari by opening a command prompt:
Then create a directory for all your github projects. You could put this anywhere, e.g.,
%USERPROFILE%\github. I chose to create a directory
Use yari instead of RVM/rbenv
Scott Muc has written yari which lets you switch between Windows Ruby versions. Get it with the following command.
cd C:\projects\github\ git clone git://github.com/scottmuc/yari.git yari
Once this has completed you can setup the required Ruby environment with the command:
Then follow the rest of the instructions from the Octopress setup instructions.
git clone git://github.com/imathis/octopress.git octopress cd octopress ruby --version # Should report Ruby 1.9.2 thanks to yari
Next install dependencies
gem install bundler bundle install
Install the default Octopress theme.
Deploying to GitHub
The instructions are here. The only difficulty I had was working out which URL to use after:
This will ask you for your Github Pages repository url, but it is not clear that this is the SSH one, e.g.,
email@example.com:ZeroSharp/zerosharp.github.com.git. You can find it near the top of the repository page.
Configuring your blog
Follow the instructions here to configure your blog.
It is quite difficult to find good help on the markdown syntax other than for the codeblocks section. For instance, it is not clear how to generate a codeblock with no line numbers, like this one:
How do I output a codeblock with no line numbers?
Fonts and Styles
Problem with CodeBlocks
I had a problem with codeblocks which seems to be specific to Windows. It seems that whenever you include a
lang parameter in a
codeblock, you get:
Liquid error: No such file or directory - python2.7 -c “import sys; print sys.executable”
There are two issues:
- Syntax highlighting requires Python which is not automatically installed.
- There is a problem with pythonexec.rb which does not seem to support Windows Python installations very well.
Then modify the pythonrubyexec.rb which is in the depths of the yari subdirectory. Try here:
At the top of pythonexec.rb, modify the file as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16