Created
November 16, 2011 10:48
-
-
Save portwaypoint/1369801 to your computer and use it in GitHub Desktop.
Jekyll youtube liquid template tag
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 Youtube < Liquid::Tag | |
@@width = 640 | |
@@height = 510 | |
def initialize(name, id, tokens) | |
super | |
@id = id | |
end | |
def render(context) | |
%(<iframe width="#{@@width}" height="#{@@height}" src="http://www.youtube.com/embed/#{@id}" frameborder="0" allowfullscreen></iframe>) | |
end | |
end | |
end | |
Liquid::Template.register_tag('youtube', Jekyll::Youtube) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment