1
0
mirror of https://github.com/TeamNewPipe/website synced 2025-10-06 00:22:38 +02:00
Files
website/_plugins/git_hash.rb

21 lines
528 B
Ruby

module Jekyll
#
# Show the hash of current Git HEAD.
#
class GitHash < Liquid::Tag
include Jekyll::LiquidExtensions
def getRawHash()
hash = %x( git rev-parse --short HEAD )
# remove newlines and other whitespaces at the beginning and end of the hash
# for some reason one strip is not enough
return hash.strip
end
def render(context)
getRawHash()
end
end
end
Liquid::Template.register_tag('git_hash', Jekyll::GitHash)