Created
June 30, 2013 19:22
-
-
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> %}
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 | |
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