Created
March 17, 2012 19:39
-
-
Save jamieowen/2064687 to your computer and use it in GitHub Desktop.
Octopress Vimeo plugin...
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 Vimeo < Liquid::Tag | |
@width = 400 | |
@height = 225 | |
def initialize(name, id, tokens) | |
super | |
@id = id | |
end | |
def render(context) | |
%(<iframe width="#{@width}" height="#{@height}" src="http://player.vimeo.com/video/#{@id}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>) | |
end | |
end | |
end | |
Liquid::Template.register_tag('vimeo', Jekyll::Vimeo) |
Hi Bouni,
Thats fixed now.. The id was mistakenly declared as a static variable ( @@ ) so was being shared across both vimeo plugins!
Cheers
Tanks for the fast solution Jamie!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Jamie,
i have a problem with your plugin. If i use it twice in one post the id of the last video is set for both videos.
Any idea why this happens?
I'm not familiar with ruby and octopress plugins and cannot see the problem.
Thanks