From 21803814bc2d30660fe7e83fb6894c37ea886201 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Sun, 16 Oct 2011 13:37:06 +0200 Subject: Adds parameter for left aligned pullquotes, fixes #215 --- plugins/pullquote.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb index 5dd6a553..cf8d22f1 100644 --- a/plugins/pullquote.rb +++ b/plugins/pullquote.rb @@ -13,18 +13,20 @@ #

# # When writing longform posts, I find it helpful to include pullquotes, which help those scanning a post discern whether or not a post is helpful. -# It is important to note, pullquotes are merely visual in presentation and should not appear twice in the text. This is why a CSS only approach # for styling pullquotes is prefered. +# It is important to note, pullquotes are merely visual in presentation and should not appear twice in the text. This is why a CSS only approach +# for styling pullquotes is prefered. # #

# -# Strand's modification adds the ability to call this plugin with {% pullquote left %} which duplicates the current behavior of the pullquote plugin, with a left float and appropriate margins. -# Note: this version of the plugin now creates pullquotes with the class of pullquote-right by default +# {% pullquote left %} will create a left-aligned pullquote instead. +# +# Note: this plugin now creates pullquotes with the class of pullquote-right by default module Jekyll class PullquoteTag < Liquid::Block def initialize(tag_name, markup, tokens) - markup =~ /left/i ? @align = "left" : @align = "right" + @align = (markup =~ /left/i) ? "left" : "right" super end @@ -32,7 +34,7 @@ module Jekyll output = super if output.join =~ /\{"\s*(.+)\s*"\}/ @quote = $1 - "#{output.join.gsub(/\{"\s*|\s*"\}/, '')}" # TODO Determine how to makethis span have a left or right flag. + "#{output.join.gsub(/\{"\s*|\s*"\}/, '')}" else return "Surround your pullquote like this {\" text to be quoted \"}" end -- cgit v1.2.1