From efb2489b079ce2522d480c64c7e9d3a30fbd73b6 Mon Sep 17 00:00:00 2001 From: Maruan Al-Shedivat Date: Tue, 5 Jul 2016 04:50:43 -0400 Subject: [PATCH] Fix baseurl. Add gh-pages deployment script. --- _config.yml | 2 +- bin/deploy | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 bin/deploy diff --git a/_config.yml b/_config.yml index 9e702ca..9d71d81 100644 --- a/_config.yml +++ b/_config.yml @@ -9,7 +9,7 @@ description: > # this means to ignore newlines until "url:" last_updated: July 5, 2016 url: # the base hostname & protocol for your site -baseurl: # the subpath of your site, e.g. /blog/ +baseurl: /al-folio/ # the subpath of your site, e.g. /blog/ # Social github_username: # put your github username diff --git a/bin/deploy b/bin/deploy new file mode 100755 index 0000000..59d0668 --- /dev/null +++ b/bin/deploy @@ -0,0 +1,35 @@ +#!/usr/bin/env sh + +# Run this script to deploy the app to Github Pages. + +# Exit if any subcommand fails. +set -e + +echo "Started deploying" + +# Checkout gh-pages branch. +if [ `git branch | grep gh-pages` ] +then + git branch -D gh-pages +fi +git checkout -b gh-pages + +# Build site. +jekyll build + +# Delete and move files. +find . -maxdepth 1 ! -name '_site' ! -name '.git' ! -name '.gitignore' -exec rm -rf {} \; +mv _site/* . +rm -R _site/ + +# Push to gh-pages. +git add -fA +git commit --allow-empty -m "$(git log -1 --pretty=%B) [ci skip]" +git push -f -q origin gh-pages + +# Move back to previous branch. +git checkout - + +echo "Deployed Successfully!" + +exit 0