mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
'gist' liquid tag by @stereobooster. Fixes #463.
This commit is contained in:
committed by
Parker Moore
parent
cc0f84197a
commit
425f466842
19
lib/jekyll/tags/gist.rb
Normal file
19
lib/jekyll/tags/gist.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# Gist Liquid Tag
|
||||
#
|
||||
# Example:
|
||||
# {% gist 1234567 %}
|
||||
|
||||
module Jekyll
|
||||
class GistTag < Liquid::Tag
|
||||
def initialize(tag_name, gist, tokens)
|
||||
super
|
||||
@gist = gist
|
||||
end
|
||||
|
||||
def render(context)
|
||||
"<script src=\"http://gist.github.com/#{@gist}.js\" type=\"text/javascript\"></script>"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_tag('gist', Jekyll::GistTag)
|
||||
Reference in New Issue
Block a user