Guest User

Untitled

a guest
Jan 19th, 2012
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. # An example Jekyll Liquid tag. Utilizes the new plugin system.
  2. #
  3. # 1. Make a _plugins directory in your jekyll site, and put this class in a file there.
  4. # 2. In anyone of your pages, you can use the 'render_time' liquid tag like so:
  5. # {% render_time Page generated at: %}
  6.  
  7. module Jekyll
  8. class RenderTimeTag < Liquid::Tag
  9.  
  10. def initialize(tag_name, text, tokens)
  11. super
  12. @text = text
  13. end
  14.  
  15. def render(context)
  16. "#{@text} #{Time.now}"
  17. end
  18. end
  19. end
  20.  
  21. Liquid::Template.register_tag('render_time', Jekyll::RenderTimeTag)
Advertisement
Add Comment
Please, Sign In to add comment