Last active
December 15, 2015 08:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this, drop this file into your
_plugins/
folder and use{% jekyll_version %}
in your template where you want to access it.