Skip to content

Instantly share code, notes, and snippets.

@slava-vishnyakov
Forked from jamieowen/youtube.rb
Created November 4, 2012 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slava-vishnyakov/4010922 to your computer and use it in GitHub Desktop.
Save slava-vishnyakov/4010922 to your computer and use it in GitHub Desktop.
Octopress Youtube plugin...
module Jekyll
class Youtube < Liquid::Tag
@width = 640
@height = 390
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" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>)
end
end
end
Liquid::Template.register_tag('youtube', Jekyll::Youtube)
@jbruni
Copy link

jbruni commented Dec 29, 2013

Thanks! I will use in my Octopress blog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment