public
Last active

  • Download Gist
_plugins/render_time.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# An example Jekyll Liquid tag. Utilizes the new plugin system.
#
# 1. Make a _plugins directory in your jekyll site, and put this class in a file there.
# 2. In anyone of your pages, you can use the 'render_time' liquid tag like so:
# {% render_time Page generated at: %}
 
module Jekyll
class RenderTimeTag < Liquid::Tag
 
def initialize(tag_name, text, tokens)
super
@text = text
end
 
def render(context)
"#{@text} #{Time.now}"
end
end
end
 
Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.