diff options
author | Matthew Marchese <maffblaster@gentoo.org> | 2022-02-12 13:41:02 -0800 |
---|---|---|
committer | Matthew Marchese <maffblaster@gentoo.org> | 2022-02-12 13:41:02 -0800 |
commit | 009171402090a632986cc4ad252ab36f097664b3 (patch) | |
tree | 310ba1f05e586f0a266690356b2424f5fc498478 | |
parent | Add instructions for building/running with Docker. (diff) | |
download | www-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.html | 2 | ||||
-rw-r--r-- | _plugins/tags.rb | 12 |
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>© {{ site.copyrightyears }} Gentoo Authors</strong><br> + <strong>© 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) + |