summaryrefslogtreecommitdiff
path: root/_plugins/gitrev.rb
diff options
context:
space:
mode:
Diffstat (limited to '_plugins/gitrev.rb')
-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)