aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFrederic Hemberger <mail@frederic-hemberger.de>2011-10-16 13:19:42 +0200
committerFrederic Hemberger <mail@frederic-hemberger.de>2011-10-16 13:19:42 +0200
commit2dedad61769344f629b31479e936ee3ea05a8ccb (patch)
treedec647c5f19c15259dd114e80622d170f06e6da3 /plugins
parent82942bd0885afc343e8c6bd14fd3e117b2d6c05a (diff)
parent2e7bc43cf7d3d0b11381ad131baae870f64f2d71 (diff)
downloadmy_new_personal_website-2dedad61769344f629b31479e936ee3ea05a8ccb.tar.xz
my_new_personal_website-2dedad61769344f629b31479e936ee3ea05a8ccb.zip
Merge branch 'master' of https://github.com/strand/octopress into strand/octopress
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pullquote.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb
index 03e307a7..5dd6a553 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,14 @@
# </span>
# </p>
#
+# 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
module Jekyll
class PullquoteTag < Liquid::Block
def initialize(tag_name, markup, tokens)
+ markup =~ /left/i ? @align = "left" : @align = "right"
super
end
@@ -29,7 +32,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='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