Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin for posting YouTube and Vimeo videos. First post using such a …
…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
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |