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 /_plugins | |
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>
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/tags.rb | 12 |
1 files changed, 11 insertions, 1 deletions
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) + |