summaryrefslogtreecommitdiff
path: root/_plugins/gitrev.rb
blob: 7f72bb9ca983506b35f3b3ecb887c0d95282a771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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)