Skip to content

Commit

Permalink
Plugin for posting YouTube and Vimeo videos. First post using such a …
Browse files Browse the repository at this point in the history
…link.

The plugin was found here:
https://gist.github.com/ryanburnette/6107142

And I reported a correction using " instead of ' in the Ruby code.
  • Loading branch information
wahn committed Aug 29, 2014
1 parent e7dd6d0 commit 61948f9
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
44 changes: 44 additions & 0 deletions _plugins/video-embed.rb
@@ -0,0 +1,44 @@
class YouTube < Liquid::Tag
def initialize(tagName, markup, tokens)
super

args = markup.split(' ')
@id = args[0]
@width = 500
@height = 281

if args[1]
@width = args[1]
@height = args[2]
end
end

def render(context)
"<div class=\"youtube\"><iframe width=\"#{@width}\" height=\"#{@height}\" src=\"http://www.youtube.com/embed/#{@id}?color=white&theme=light\"> </iframe></div>"
end

Liquid::Template.register_tag("youtube", self)
end

class Vimeo < Liquid::Tag
def initialize(tagName, markup, tokens)
super

args = markup.split(' ')
@id = args[0]
@width = 500
@height = 281

if args[1]
@width = args[1]
@height = args[2]
end
end

def render(context)
"<div class=\"vimeo\"><iframe src=\"http://player.vimeo.com/video/#{@id}\" width=\"#{@width}\" height=\"#{@height}\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen> </iframe></div>"
end

Liquid::Template.register_tag("vimeo", self)
end

8 changes: 8 additions & 0 deletions _posts/2014-08-29-video-vimeo-francis.markdown
@@ -0,0 +1,8 @@
---
layout: post
title: "Richard Hickey - Francis"
date: 2014-08-29 15:52:38
categories: jekyll video francis
---

{% vimeo 84786815 500 213 %}

0 comments on commit 61948f9

Please sign in to comment.