Commit 55890a17 by Peter Serwylo Committed by Hans-Christoph Steiner

Add output of `git describe` to footer.

Helps with diagnosing and reporting issues in the deployed website.
parent 8b8ffb3b
Pipeline #9641361 passed with stages
in 8 minutes 13 seconds
......@@ -3,7 +3,12 @@
<div class="wrapper">
<div class="site-description">
<p>{{ site.description }}</p>
<p>
{{ site.description }}
<span class="version">
(fdroid-website <a href="https://gitlab.com/fdroid/fdroid-website/tree/{% git_hash %}">{% git_tag %}</a>)
</span>
</p>
</div>
</div>
......
require 'git'
module Jekyll
class GitInfoTag < Liquid::Tag
def git()
git_dir = File.expand_path File.dirname(File.dirname(__FILE__))
Git.open(git_dir)
end
end
#
# Show the latest tag.
# If the current commit is the latest tag, then show just the tag name.
# If not, show the latest tag, how many commits we are in front, and the hash of HEAD.
#
class GitTag < GitInfoTag
include Jekyll::LiquidExtensions
def render(context)
git().describe('HEAD')
end
end
#
# Show the hash of HEAD.
#
class GitHash < GitInfoTag
include Jekyll::LiquidExtensions
def render(context)
git().object('HEAD').sha[0..9]
end
end
end
Liquid::Template.register_tag('git_tag', Jekyll::GitTag)
Liquid::Template.register_tag('git_hash', Jekyll::GitHash)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment