Skip to content

Instantly share code, notes, and snippets.

@jankeesvw
Created January 18, 2013 15:32
Show Gist options
  • Save jankeesvw/4565340 to your computer and use it in GitHub Desktop.
Save jankeesvw/4565340 to your computer and use it in GitHub Desktop.
module Jekyll
class CodeTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@language = text
end
def render(context)
"<pre data-language='#{@language}'><code>"
end
end
end
module Jekyll
class CodeEndTag < Liquid::Tag
def initialize(tag_name, text, tokens)
super
end
def render(context)
"</code></pre>"
end
end
end
Liquid::Template.register_tag('code', Jekyll::CodeTag)
Liquid::Template.register_tag('endcode', Jekyll::CodeEndTag)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment