summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_includes/header.html2
-rw-r--r--_plugins/gitrev.rb13
2 files changed, 14 insertions, 1 deletions
diff --git a/_includes/header.html b/_includes/header.html
index a39c338..7a339d5 100644
--- a/_includes/header.html
+++ b/_includes/header.html
@@ -1,5 +1,5 @@
<header class="site-header" role="banner">
-
+ <!-- built from {% git_rev %} -->
<div class="wrapper">
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
diff --git a/_plugins/gitrev.rb b/_plugins/gitrev.rb
new file mode 100644
index 0000000..7f72bb9
--- /dev/null
+++ b/_plugins/gitrev.rb
@@ -0,0 +1,13 @@
+module Jekyll
+ class RenderGitVerTag < Liquid::Tag
+ def initialize(tag_name, text, tokens)
+ super
+ end
+
+ def render(context)
+ `git rev-parse HEAD`.strip
+ end
+ end
+end
+
+Liquid::Template.register_tag('git_rev', Jekyll::RenderGitVerTag)