more efficient static file handling

This commit is contained in:
Danny Berger
2014-03-30 23:00:31 -06:00
parent bc75fd4607
commit 5e9da5addc
4 changed files with 9 additions and 5 deletions

View File

@@ -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"

View File

@@ -6,6 +6,7 @@ environment: dev
artifact_commit: dev
artifact_branch: master
asset_prefix: /asset
static_prefix: /static/dev
exclude:
- LICENSE
- README

View File

@@ -6,9 +6,9 @@
<title>{% if page.title != "Home" %}{{ page.title }} &ndash; {% endif %}Danny Berger</title>
<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css" />
<link href="/static/{{ site.artifact_commit|truncate:10,'' }}/style/default-common.css" rel="stylesheet" type="text/css" />
<link href="/static/{{ site.artifact_commit|truncate:10,'' }}/style/default-print.css" media="print" rel="stylesheet" type="text/css" />
<link href="/static/{{ site.artifact_commit|truncate:10,'' }}/style/pygments.css" rel="stylesheet" type="text/css" />
<link href="{{ site.static_prefix }}/style/default-common.css" rel="stylesheet" type="text/css" />
<link href="{{ site.static_prefix }}/style/default-print.css" media="print" rel="stylesheet" type="text/css" />
<link href="{{ site.static_prefix }}/style/pygments.css" rel="stylesheet" type="text/css" />
<link href="/blog/atom.xml" type="application/atom+xml" rel="alternate" title="Danny Berger (blog)" />
{% if page.path %}

View File

@@ -9,7 +9,7 @@
<a href="https://maps.google.com/maps?hl=en&amp;ll={{ page.location.latitude }},{{ page.location.longitude }}&amp;t=w&amp;z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ page.location.latitude }},{{ page.location.longitude }}&amp;zoom=9&amp;size=98x98&amp;sensor=false" title="{{ page.location.title }}" width="49" /></a>
{% endif %}
{% if page.code %}
<a href="{{ page.code }}"><img alt="code" height="49" src="/static/{{ site.artifact_commit|truncate:10,'' }}/icon/code.png" width="49" /></a>
<a href="{{ page.code }}"><img alt="code" height="49" src="{{ site.static_prefix }}/icon/code.png" width="49" /></a>
{% endif %}
</div>
<div class="social screen-only">