aboutsummaryrefslogtreecommitdiff
path: root/plugins/pullquote.rb
diff options
context:
space:
mode:
authorstrand <jet.strand@gmail.com>2011-10-11 15:59:25 -0700
committerstrand <jet.strand@gmail.com>2011-10-11 15:59:25 -0700
commit8897083cf7b90c0f8e08d0b0932eed2c3baf9684 (patch)
treeff7de64a4b999ee6ef8e6469aae57992125cd4b9 /plugins/pullquote.rb
parent86c72a4ca6355813677335351b6fce2d82d55a46 (diff)
downloadmy_new_personal_website-8897083cf7b90c0f8e08d0b0932eed2c3baf9684.tar.xz
my_new_personal_website-8897083cf7b90c0f8e08d0b0932eed2c3baf9684.zip
Implemented pullquoteleft functionality
Diffstat (limited to 'plugins/pullquote.rb')
-rw-r--r--plugins/pullquote.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb
index 03e307a7..6d175e83 100644
--- a/plugins/pullquote.rb
+++ b/plugins/pullquote.rb
@@ -1,10 +1,10 @@
#
# Author: Brandon Mathis
-# Based on the sematic pullquote technique by Maykel Loomans at http://miekd.com/articles/pull-quotes-with-html5-and-css/
+# Based on the semantic pullquote technique by Maykel Loomans at http://miekd.com/articles/pull-quotes-with-html5-and-css/
#
# Outputs a span with a data-pullquote attribute set from the marked pullquote. Example:
#
-# {% pullquote %}
+# {% pullquote %}
# 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. "} That is why it is prefered
# to use a CSS only technique for styling pullquotes.
@@ -17,11 +17,13 @@
# </span>
# </p>
#
+# Strand's modification adds the ability to call this plugin with {% pullquote align:left %} which duplicates the current behavior of the pullquote plugin, with a left float and appropriate margins.
module Jekyll
class PullquoteTag < Liquid::Block
def initialize(tag_name, markup, tokens)
+ markup =~ /align:left/i ? @align = "left" : @align = ""
super
end
@@ -29,7 +31,7 @@ module Jekyll
output = super
if output.join =~ /\{"\s*(.+)\s*"\}/
@quote = $1
- "<span class='has-pullquote' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>"
+ "<span class='has-pullquote#{@align}' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>" # TODO Determine how to makethis span have a left or right flag.
else
return "Surround your pullquote like this {\" text to be quoted \"}"
end