aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Marchese <maffblaster@gentoo.org>2022-02-12 13:41:02 -0800
committerMatthew Marchese <maffblaster@gentoo.org>2022-02-12 13:41:02 -0800
commit009171402090a632986cc4ad252ab36f097664b3 (patch)
tree310ba1f05e586f0a266690356b2424f5fc498478
parentAdd instructions for building/running with Docker. (diff)
downloadwww-009171402090a632986cc4ad252ab36f097664b3.tar.gz
www-009171402090a632986cc4ad252ab36f097664b3.tar.bz2
www-009171402090a632986cc4ad252ab36f097664b3.zip
Add new liquid tag to support current year.
As long as this site uses Jekyll, current year should always automatically generate correctly. Signed-off-by: Matthew Marchese <maffblaster@gentoo.org>
-rw-r--r--_includes/layout/footer.html2
-rw-r--r--_plugins/tags.rb12
2 files changed, 12 insertions, 2 deletions
diff --git a/_includes/layout/footer.html b/_includes/layout/footer.html
index d0843f0..9b6e909 100644
--- a/_includes/layout/footer.html
+++ b/_includes/layout/footer.html
@@ -29,7 +29,7 @@
</div>
</div>
<div class="col-xs-8 col-md-8">
- <strong>&copy; {{ site.copyrightyears }} Gentoo Authors</strong><br>
+ <strong>&copy; 2001-{% render_current_year %} Gentoo Authors</strong><br>
<small>
Gentoo is a trademark of the Gentoo Foundation, Inc.
The contents of this document, unless otherwise expressly stated, are licensed under the
diff --git a/_plugins/tags.rb b/_plugins/tags.rb
index 6e08746..66bfb64 100644
--- a/_plugins/tags.rb
+++ b/_plugins/tags.rb
@@ -42,8 +42,18 @@ module Gentoo
`git rev-parse --short HEAD`
end
end
- end
+
+ class CurrentYearTag < Liquid::Tag
+ def render(context)
+ `date +%Y`
+ end
+ end
+
+
+end
end
Liquid::Template.register_tag('render_ads', Gentoo::Tags::AdsTag)
Liquid::Template.register_tag('render_version', Gentoo::Tags::VersionTag)
+Liquid::Template.register_tag('render_current_year', Gentoo::Tags::CurrentYearTag)
+