From 5e9da5addc9badd6cee087484beacadd36829255 Mon Sep 17 00:00:00 2001 From: Danny Berger Date: Sun, 30 Mar 2014 23:00:31 -0600 Subject: [PATCH] more efficient static file handling --- _build/build.sh | 5 ++++- _config.yml | 1 + _includes/header.html | 6 +++--- _layouts/post.html | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/_build/build.sh b/_build/build.sh index 9814fa3..36201a2 100755 --- a/_build/build.sh +++ b/_build/build.sh @@ -15,18 +15,21 @@ cd _build/target export ARTIFACT_COMMIT=`git rev-parse HEAD` export ARTIFACT_BRANCH=`git rev-parse --abbrev-ref HEAD` +STATIC_NAME=`git rev-list -1 HEAD -- 'static/dev' | cut -c-10` + echo "--> building $ARTIFACT_BRANCH/$ARTIFACT_COMMIT..." ( echo 'artifact_commit:' "$ARTIFACT_COMMIT" ; echo 'artifact_branch:' "$ARTIFACT_BRANCH" ; echo 'asset_prefix: //assets.dpb587.me/asset' ; + echo "static_prefix: /static/$STATIC_NAME" ; echo 'environment: prod' ) > _config.patch.yml jekyll build --config _config.yml,_config.patch.yml -mv _site/static/dev _site/static/`echo $ARTIFACT_COMMIT | cut -c-10` +mv _site/static/dev _site/static/$STATIC_NAME export ARTIFACT_PATH="$RPWD/_build/target/_site" diff --git a/_config.yml b/_config.yml index 809d600..f3003cc 100644 --- a/_config.yml +++ b/_config.yml @@ -6,6 +6,7 @@ environment: dev artifact_commit: dev artifact_branch: master asset_prefix: /asset +static_prefix: /static/dev exclude: - LICENSE - README diff --git a/_includes/header.html b/_includes/header.html index 8e13034..082ebd5 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -6,9 +6,9 @@ {% if page.title != "Home" %}{{ page.title }} – {% endif %}Danny Berger - - - + + + {% if page.path %} diff --git a/_layouts/post.html b/_layouts/post.html index 6ecae9c..97db04d 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -9,7 +9,7 @@ map {% endif %} {% if page.code %} - code + code {% endif %}