Skip to content

Instantly share code, notes, and snippets.

@mopsled
Last active December 10, 2015 03:58
Show Gist options
  • Save mopsled/4378238 to your computer and use it in GitHub Desktop.
Save mopsled/4378238 to your computer and use it in GitHub Desktop.
Liquid::Tag bare-bones implementation
module Jekyll
class MyCustomTag < Liquid::Tag
def initialize(tag_name, params, tokens)
super
@params = params.strip
end
def render(context)
"Received params: '#{@params}'!"
end
end
end
Liquid::Template.register_tag('my_custom_tag', Jekyll::MyCustomTag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment