Skip to content

Instantly share code, notes, and snippets.

@ChimeraCoder
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChimeraCoder/9159683 to your computer and use it in GitHub Desktop.
Save ChimeraCoder/9159683 to your computer and use it in GitHub Desktop.
Use represent to generate the static pages for a directory and automatically publish it to Github
#! /bin/sh
set -e
PROJECT_URL=$1
# Clone into temporary directory
TMPDIR=$(mktemp -d)
cd $TMPDIR
git clone $1 .
# Use `represent` to create the pages
represent
git checkout --orphan gh-pages
git rm -f * --ignore-unmatch
mv ./publish/* .
# This should only match one file
mv *.html index.html
rmdir publish
git add .
git commit -a -m "First pages commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment