This is a plugin meant for Jekyll.
Example use:
Easily embed a YouTube video. Just drop this file in your _plugins
directory.
{% youtube oHg5SJYRHA0 %}
You can also specify a height and width. If you do not, it defaults to 560 x 420.
{% youtube oHg5SJYRHA0 500 400 %}
@avclark.
Now It's 2016. I'm new in Jekyll. but I want to answer for @avclark.
If you want to use this: {% youtube{{ post.video }} %}. You only write: {% youtube post.video %}.
And override code above:
As you see. I have added new row: They are @content = markup and @id = "#{context[@content.strip]}"
I have tried and It works well :)
But If you want to use: {% youtube post.video 500 600 %}. You must change something: you can try as this:
Syntax = /^\s_([^\s]+)(\s+(\d+)\s+(\d+)\s_)?/
def initialize(tagName, markup, tokens)
super
if markup =~ Syntax then
@url_id = $1
end
def render(context)
@id = "#{context[@url_id.strip]}"
"<iframe width="#{@width}" height="#{@height}" src="http://www.youtube.com/embed/#{@id}?color=white&theme=light\"></iframe>"
end
Liquid::Template.register_tag "youtube", self
end