aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '_plugins/tags.rb')
-rw-r--r--_plugins/tags.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/_plugins/tags.rb b/_plugins/tags.rb
index 66bfb64..0f6a0da 100644
--- a/_plugins/tags.rb
+++ b/_plugins/tags.rb
@@ -1,4 +1,5 @@
require_relative 'lib/weightedrandomizer'
+require 'time'
module Gentoo
module Tags
@@ -45,7 +46,13 @@ module Gentoo
class CurrentYearTag < Liquid::Tag
def render(context)
- `date +%Y`
+ Time.now.utc.year.to_s
+ end
+ end
+
+ class GenerationTimestampTag < Liquid::Tag
+ def render(context)
+ Time.now.utc.iso8601
end
end
@@ -56,4 +63,5 @@ 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)
+Liquid::Template.register_tag('render_generation_timestamp', Gentoo::Tags::GenerationTimestampTag)