summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok cheetah2020-05-27 21:25:12 +0200
committeruvok cheetah2020-05-27 21:25:12 +0200
commit1730a13638f0b2a9f8f5ddda001c1310dcdf2ba2 (patch)
tree37d5d0d8b56c2c2a11bd766f8347ec0e17a21307
parentb051c0fc84118ae0c57e33612a0c00a92f5a51aa (diff)
Add git revision
-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)