Updating Octopress On OS X 10.9 Mavericks & Restoring Colors & Fonts


I use Octopress to create a number of sites that I host on different domains. I always seem to have problems updating my Octopress site directories to the latest version of Octopress. In particular I keep losing the changes I have made to site colors and fonts. The updating has been further complicated on OS X 10.9 Mavericks as there is a problem when using Safari to preview sites via http://localhost. Combining the work of others with my own, I have finally worked out a way that I can make the Octopress update on Mavericks and restore my color and font changes.

Octopress Instructions

I start with the normal Octopress update instructions. (Here I have assumed ~/octopress is the directory holding your Octopress site.)

cd ~/octopress  
git pull octopress master     # Get the latest Octopress  
bundle install                # Keep gems updated  
rake update_source            # update the template's source  
rake update_style             # update the template's style  

(When I ran this update my Octopress clones were updated to commit 64ba603, dated November 18, 2013.)

OS X Mavericks Corrections

When previewing the new Octopress blog via http://localhost:4000 on Mavericks with Safari, I got a blank page. This seems to be a known issue which is unfortunately closed. Fortunately Chen-Yai Lai has provided a solution, which for me is run as follows:

cd ~/octopress  
echo gem \"thin\" >> Gemfile  
bundle install  

Restoring Custom Colors and Fonts To The sass/custom Files

The rake update_style instructions do not seem to work correctly for me and my revised colors and fonts do not get changed after an update. So I have used the following method to restore my colors and fonts. First I check what are the differences between the new and old colors and fonts files using git diff:

cd ~/octopress
git diff sass/custom/_colors.scss  
git diff sass/custom/_fonts.scss  

Provided the differences are only associated with the changes I made previously, I then roll back to my color and font changes in the old files by using git checkout.

cd ~/octopress  
git checkout -- sass/custom/_colors.scss  
git checkout -- sass/custom/_fonts.scss  

If the changes are a mixture of your own changes plus new Octopress changes then you will have to manually roll back the changes yourself. An editor such as TextWrangler can help with this as it allows you to compare two files and move around individual sets of changes within the files.

Gareth Digby
Curriculum Architect

A blog by a Mac User.