summaryrefslogtreecommitdiff
path: root/_plugins
diff options
context:
space:
mode:
authoruvok cheetah2020-05-27 21:25:12 +0200
committeruvok cheetah2020-05-27 21:25:12 +0200
commit1730a13638f0b2a9f8f5ddda001c1310dcdf2ba2 (patch)
tree37d5d0d8b56c2c2a11bd766f8347ec0e17a21307 /_plugins
parentb051c0fc84118ae0c57e33612a0c00a92f5a51aa (diff)
Add git revision
Diffstat (limited to '_plugins')
-rw-r--r--_plugins/gitrev.rb13
1 files changed, 13 insertions, 0 deletions
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)