From ee7b9dd9581a048cee17e89181cba94254033fb2 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Mon, 11 Jul 2011 11:17:15 -0400 Subject: Changed _plugins folder to plugins and updated rake tasks accordingly --- .themes/classic/_plugins/blockquote.rb | 73 ---------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 .themes/classic/_plugins/blockquote.rb (limited to '.themes/classic/_plugins/blockquote.rb') diff --git a/.themes/classic/_plugins/blockquote.rb b/.themes/classic/_plugins/blockquote.rb deleted file mode 100644 index 2f0712bd..00000000 --- a/.themes/classic/_plugins/blockquote.rb +++ /dev/null @@ -1,73 +0,0 @@ -# -# Author: Brandon Mathis -# Based on the work of: Josediaz Gonzalez - https://github.com/josegonzalez/josediazgonzalez.com/blob/master/_plugins/blockquote.rb -# -# Outputs a string with a given attribution as a quote -# -# {% blockquote Bobby Willis http://google.com/blah the search for bobby's mom %} -# Wheeee! -# {% endblockquote %} -# ... -#
-#

Wheeee!

-#
-# -require './_plugins/titlecase.rb' -module Jekyll - - class Blockquote < Liquid::Block - FullCiteWithTitle = /([\w\s]+)(https?:\/\/)(\S+\s)([\w\s]+)/i - FullCite = /([\w\s]+)(https?:\/\/)(\S+)/i - Author = /([\w\s]+)/ - - def initialize(tag_name, markup, tokens) - @by = nil - @source = nil - @title = nil - if markup =~ FullCiteWithTitle - @by = $1 - @source = $2 + $3 - @title = $4.titlecase - elsif markup =~ FullCite - @by = $1 - @source = $2 + $3 - elsif markup =~ Author - @by = $1 - end - super - end - - def render(context) - output = paragraphize(super.map(&:strip).join) - author = "#{@by.strip}" - if @source - url = @source.match(/https?:\/\/(.+)/)[1].split('/') - parts = [] - url.each do |part| - if (parts + [part]).join('/').length < 32 - parts << part - end - end - source = parts.join('/') - source << '/…' unless source == @source - end - cite = "#{(@title || source)}" - reply = if @by.nil? - output - elsif !@source.nil? - "#{output}" - else - "#{output}" - end - "
#{reply}
" - end - - def paragraphize(input) - "

#{input.gsub(/\n\n/, '

').gsub(/\n/, '
')}

" - end - end -end - -Liquid::Template.register_tag('blockquote', Jekyll::Blockquote) -- cgit v1.2.1