diff options
author | uvok cheetah | 2020-05-27 21:25:12 +0200 |
---|---|---|
committer | uvok cheetah | 2020-05-27 21:25:12 +0200 |
commit | 1730a13638f0b2a9f8f5ddda001c1310dcdf2ba2 (patch) | |
tree | 37d5d0d8b56c2c2a11bd766f8347ec0e17a21307 | |
parent | b051c0fc84118ae0c57e33612a0c00a92f5a51aa (diff) |
Add git revision
-rw-r--r-- | _includes/header.html | 2 | ||||
-rw-r--r-- | _plugins/gitrev.rb | 13 |
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) |