sg publishing system. Photographs are © Simon Griffee. All rights reserved. Feel free to use the code, based on Jekyll, but please change the visual design (typography, color, etc) to make it your own.


Static site generation template for

Uses Jekyll.

Preview site locally

jekyll serve -w

…Or with local apache pointing to, just go to in browser

Deployment of _site folder via rsync to avoid problem of overwriting existing files on server root

rsync -exclude='.DS_Store' -cavzhe ssh ~/Sites/

…Or use the deploy script (after first making it executable with chmod +x deploy):

. deploy

See this and this regarding Jekyll's mangling of timestamps

Things to do

  1. Refactor stories CSS into main stylesheet
  2. Setup make file deployment to preserve timestamps using this technique?
  3. Setup Git deployment with detached work tree and post-commit hook — see below
  4. Setup bittorrent sync or git-annex? for deployment of entire site or of images folder?
  5. HTTPS and redirect
  6. Search via JavaScript? Currently using Duck Duck Go.
  7. Compression of sitemap.xml before uploading?
  8. Streamlined command for creating post
  9. Refactor stories section like this

Alternative automatic deployment of stories section with Git

A. Make sure Jekyll and RubyGems are installed on both local and server machines.

B. On local:


    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = [email protected]:hypertexthero/sg.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[remote "deploy"]
    url = [email protected]:~/repos/sg.git
    fetch = +refs/heads/*:refs/remotes/deploy/*
[remote "all"]
    url = [email protected]:~/repos/sg.git
    url = [email protected]:hypertexthero/sg.git

C. On server:

Make sure these folders exist:


Put the following in ~/repos/



jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW

Run this command to make it executable:

chmod +x post-receive

D. To deploy:

git add .
git commit -m 'short description of change'
git push all