Last active
August 29, 2015 13:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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