more efficient static file handling
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ environment: dev
|
||||
artifact_commit: dev
|
||||
artifact_branch: master
|
||||
asset_prefix: /asset
|
||||
static_prefix: /static/dev
|
||||
exclude:
|
||||
- LICENSE
|
||||
- README
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<title>{% if page.title != "Home" %}{{ page.title }} – {% 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 %}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<a href="https://maps.google.com/maps?hl=en&ll={{ page.location.latitude }},{{ page.location.longitude }}&t=w&z=12"><img alt="map" height="49" src="https://maps.googleapis.com/maps/api/staticmap?center={{ page.location.latitude }},{{ page.location.longitude }}&zoom=9&size=98x98&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">
|
||||
|
||||
Reference in New Issue
Block a user