Static site generation template for simongriffee.com
Preview site locally
jekyll serve -w
…Or with local apache pointing to sg.dev, just go to http://sg.dev 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/sg.dev/ firstname.lastname@example.org:webapps/simongriffee/
…Or use the deploy script (after first making it executable with
chmod +x deploy):
Things to do
- Refactor stories CSS into main stylesheet
- Setup make file deployment to preserve timestamps using this technique?
- Setup Git deployment with detached work tree and post-commit hook — see below
- Setup bittorrent sync or git-annex? for deployment of entire site or of images folder?
- HTTPS and redirect
- Compression of sitemap.xml before uploading?
- Streamlined command for creating post
- 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:
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] url = email@example.com:hypertexthero/sg.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [remote "deploy"] url = firstname.lastname@example.org:~/repos/sg.git fetch = +refs/heads/*:refs/remotes/deploy/* [remote "all"] url = email@example.com:~/repos/sg.git url = firstname.lastname@example.org:hypertexthero/sg.git
C. On server:
Make sure these folders exist:
Put the following in
#!/bin/sh GIT_REPO=$HOME/repos/sg.git TMP_GIT_CLONE=/home/hth/tmp/sg PUBLIC_WWW=/home/hth/webapps/sg/stories git clone $GIT_REPO $TMP_GIT_CLONE jekyll build -s $TMP_GIT_CLONE -d $PUBLIC_WWW rm -Rf $TMP_GIT_CLONE exit
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