Skip to content

Instantly share code, notes, and snippets.

@zoni
Last active December 15, 2015 08:38
Show Gist options
  • Save zoni/5232081 to your computer and use it in GitHub Desktop.
Save zoni/5232081 to your computer and use it in GitHub Desktop.
A Jekyll plugin to expose a `jekyll_version` Liquid template tag which returns the Jekyll version number
module Jekyll
class JekyllVersionTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
Jekyll::VERSION
end
end
end
Liquid::Template.register_tag('jekyll_version', Jekyll::JekyllVersionTag)
@zoni
Copy link
Author

zoni commented Mar 24, 2013

To use this, drop this file into your _plugins/ folder and use {% jekyll_version %} in your template where you want to access it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment