aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Magorsch <arzano@gentoo.org>2020-09-03 01:18:31 +0200
committerMax Magorsch <arzano@gentoo.org>2020-09-03 01:19:05 +0200
commit32fb874fe0e0a20b07b4dfe0f46ad98a675c5c36 (patch)
tree7028df48c53400cc9a4f4cdd45d5e2ea7f6e94c9
parentAdd version to the footer (diff)
downloadwww-32fb874fe0e0a20b07b4dfe0f46ad98a675c5c36.tar.gz
www-32fb874fe0e0a20b07b4dfe0f46ad98a675c5c36.tar.bz2
www-32fb874fe0e0a20b07b4dfe0f46ad98a675c5c36.zip
Fix the version in the footer
Jekyll is not using erb, thus we have to come up with some liquid plugin Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r--_includes/layout/footer.html4
-rw-r--r--_plugins/tags.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/_includes/layout/footer.html b/_includes/layout/footer.html
index 7529670..9a96174 100644
--- a/_includes/layout/footer.html
+++ b/_includes/layout/footer.html
@@ -38,9 +38,9 @@
</small>
</div>
<div class="col-xs-2 col-md-2">
- <strong><a class="text-dark" href="https://www.gentoo.org/inside-gentoo/contact/">Contact</a></strong><br>
+ <strong><a class="text-dark" href="https://gitweb.gentoo.org/sites/www.git/">Version</a></strong><br>
<small>
- <%= `git describe --tags` %>
+ {% render_version %}
</small>
</div>
</div>
diff --git a/_plugins/tags.rb b/_plugins/tags.rb
index 7ad24bb..6e08746 100644
--- a/_plugins/tags.rb
+++ b/_plugins/tags.rb
@@ -36,7 +36,14 @@ module Gentoo
ad_html
end
end
+
+ class VersionTag < Liquid::Tag
+ def render(context)
+ `git rev-parse --short HEAD`
+ end
+ end
end
end
Liquid::Template.register_tag('render_ads', Gentoo::Tags::AdsTag)
+Liquid::Template.register_tag('render_version', Gentoo::Tags::VersionTag)