Skip to content

Instantly share code, notes, and snippets.

@tmtk75
Created December 1, 2011 05:02
Show Gist options
  • Save tmtk75/1413820 to your computer and use it in GitHub Desktop.
Save tmtk75/1413820 to your computer and use it in GitHub Desktop.
## Plugin for Jekyll to use JUMLY.
module JUMLY
class Script < Liquid::Block
def initialize(tag_name, markup, tokens)
super
@markup = markup.strip
end
def render(context)
<<SCRIPT.strip
<script type="text/jumly+#{@markup}">#{@nodelist.join ""}</script>
SCRIPT
end
end
class Includes < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text.strip
end
def render(context)
<<INCLUDES.strip
<link href='http://tmtk75.github.com/jumly-core/jumly-0.1.0-rc1.min.css' rel='stylesheet' type='text/css' />
<script src='http://code.jquery.com/jquery-1.7.1.min.js' type="text/javascript"></script>
<script src='http://jashkenas.github.com/coffee-script/extras/coffee-script.js' type="text/javascript"></script>
<script src='http://tmtk75.github.com/jumly-core/jumly-0.1.0-rc1.min.js' type='text/javascript'></script>
INCLUDES
end
end
end
Liquid::Template.register_tag('jumly', JUMLY::Script)
Liquid::Template.register_tag('jumly_includes', JUMLY::Includes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment