From da514a65594ee9f2be0bcd0aa3325acc7720ffac Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Wed, 22 Jun 2011 18:53:17 -0400 Subject: 1. Updated typography for blockquotes 2. Improved blockquote Liquid tag 3. Added custom layout Sass for making layout changes simple --- themes/classic/_plugins/blockquote.rb | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'themes/classic/_plugins') diff --git a/themes/classic/_plugins/blockquote.rb b/themes/classic/_plugins/blockquote.rb index 094e4bc3..2f0712bd 100644 --- a/themes/classic/_plugins/blockquote.rb +++ b/themes/classic/_plugins/blockquote.rb @@ -11,7 +11,7 @@ #
#

Wheeee!

#
# require './_plugins/titlecase.rb' @@ -40,18 +40,33 @@ module Jekyll end def render(context) - output = super - author = "#{@by}" - cite = "#{(@title || 'source')}" + 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.join.gsub(/\n\n/, '

')}

" + output elsif !@source.nil? - "

#{output.join.gsub(/\n\n/, '

')}

" + "#{output}" else - "

#{output.join.gsub(/\n\n/, '

')}

" + "#{output}" end "
#{reply}
" end + + def paragraphize(input) + "

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

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

" + end end end -- cgit v1.2.1