-
-
Save manwithacat/231a95f1612ddaf933d5 to your computer and use it in GitHub Desktop.
Revisions
-
James Barlow revised this gist
Aug 2, 2015 . 2 changed files with 27 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,14 +2,14 @@ This is a plugin meant for [Jekyll](https://github.com/mojombo/jekyll). Example use: Easily embed a Scribd document. Just drop this file in your `_plugins` directory. ``` {% scribd 1234567 %} ``` You can also specify a height. If you do not, it defaults to 600 px ``` {% scribd 1234567 400 %} ``` This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,28 +1,41 @@ class Scribd < Liquid::Tag Syntax = /^\s*([^\s]+)(\s+(\d+)\s+(\d+)\s*)?/ def initialize(tagName, markup, tokens) super if markup =~ Syntax then # Document ID @id = $1 # Embed Paramaters @scrolling = "no" @data_aspect_ratio = "0.75" @data_auto_height = "false" #Source Paramaters @start_page = 1 @view_mode = "scroll" @access_key = "key-" + "2cvvaz8397jnhk0mcl0v" @show_recommendations = true if $2.nil? then # @width = 560 @height = 600 else # @width = $2.to_i # @height = $3.to_i @height = $2.to_i end else raise "No Scribd ID provided in the \"scribd\" tag" end end def render(context) "<iframe class=\"scribd_iframe_embed\" src=\"https://www.scribd.com/embeds/#{@id}/content?start_page=#{@start_page}&view_mode=#{@start_page}&access_key=#{@access_key}&show_recommendations=t#{@show_recommendations}\" data-auto-height=#{@data_auto_height} data-aspect-ratio=#{@data_aspect_ratio} scrolling=#{@scrolling} id=\"doc_#{@id}\" width=\"100%\" height=\"#{@height}\" frameborder=\"0\"></iframe>" end Liquid::Template.register_tag "scribd", self end -
joelverhagen revised this gist
Feb 17, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ This is a plugin meant for [Jekyll](https://github.com/mojombo/jekyll). Example use: -
joelverhagen revised this gist
Feb 17, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ This is a plugin meant for [https://github.com/mojombo/jekyll](Jekyll). Example use: -
joelverhagen revised this gist
Feb 17, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ This is a plugin meant for (https://github.com/mojombo/jekyll)[Jekyll]. Example use: Easily embed a YouTube video. Just drop this file in your `_plugins` directory. ``` {% youtube oHg5SJYRHA0 %} -
joelverhagen revised this gist
Feb 17, 2012 . 1 changed file with 19 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,28 @@ class YouTube < Liquid::Tag Syntax = /^\s*([^\s]+)(\s+(\d+)\s+(\d+)\s*)?/ def initialize(tagName, markup, tokens) super if markup =~ Syntax then @id = $1 if $2.nil? then @width = 560 @height = 420 else @width = $2.to_i @height = $3.to_i end else raise "No YouTube ID provided in the \"youtube\" tag" end end def render(context) # "<iframe width=\"#{@width}\" height=\"#{@height}\" src=\"http://www.youtube.com/embed/#{@id}\" frameborder=\"0\"allowfullscreen></iframe>" "<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 -
joelverhagen revised this gist
Feb 12, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,13 @@ Example use: Easily embed a YouTube video. ``` {% youtube oHg5SJYRHA0 %} ``` You can also specify a height and width. If you do not, it defaults to 560 x 420. ``` {% youtube oHg5SJYRHA0 500 400 %} ``` -
joelverhagen revised this gist
Feb 12, 2012 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ Example use: Easily embed a YouTube video. ``` {% youtube oHg5SJYRHA0 %} ``` You can also specify a height and width. If you do not, it defaults to 560 x 420. ``` {% youtube oHg5SJYRHA0 500 400 %} ``` -
joelverhagen created this gist
Feb 12, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ module Jekyll class YouTube < Liquid::Tag Syntax = /^\s*([^\s]+)(\s+(\d+)\s+(\d+)\s*)?/ def initialize(tagName, markup, tokens) super if markup =~ Syntax then @id = $1 if $2.nil? then @width = 560 @height = 420 else @width = $2.to_i @height = $3.to_i end else raise "No YouTube ID provided in the \"youtube\" tag" end end def render(context) "<iframe width=\"#{@width}\" height=\"#{@height}\" src=\"http://www.youtube.com/embed/#{@id}\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe>" end end end Liquid::Template.register_tag('youtube', Jekyll::YouTube)