include the git version in each file of the built site

This commit is contained in:
Sebastian Kuzminsky 2015-11-08 20:35:58 -07:00
parent a29add387b
commit 03e0fefc31
4 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
_site/ _site/
_data/version.yml

View file

@ -9,4 +9,8 @@
<!-- Custom CSS --> <!-- Custom CSS -->
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}"> <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
{% if site.data.version %}
<!-- site built from {{ site.data.version }} -->
{% endif %}
</head> </head>

View file

@ -20,6 +20,7 @@ git checkout master
git reset --hard origin/master git reset --hard origin/master
./scripts/update-version
jekyll build --trace || exit 1 jekyll build --trace || exit 1

4
scripts/update-version Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
git describe --dirty >| _data/version.yml