From 1730a13638f0b2a9f8f5ddda001c1310dcdf2ba2 Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Wed, 27 May 2020 21:25:12 +0200 Subject: Add git revision --- _plugins/gitrev.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 _plugins/gitrev.rb (limited to '_plugins/gitrev.rb') 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) -- cgit v1.2.3