Skip to content

Instantly share code, notes, and snippets.

@blackbird014
Created June 30, 2013 19:22
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 blackbird014/5896492 to your computer and use it in GitHub Desktop.
Save blackbird014/5896492 to your computer and use it in GitHub Desktop.
Allows to embed a youtube video in octopress blog just by copying it in the plugin directory and, in your post write {% youtube <videoId> %}
module Jekyll
class Youtube < Liquid::Tag
def initialize(name, id, tokens)
super
@id = id
end
def render(context)
%(<div class="embed-video-container"><iframe src="http://www.youtube.com/embed/#{@id}"></iframe></div>)
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