aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Hemberger <mail@frederic-hemberger.de>2011-10-16 13:37:06 +0200
committerFrederic Hemberger <mail@frederic-hemberger.de>2011-10-16 13:37:06 +0200
commit21803814bc2d30660fe7e83fb6894c37ea886201 (patch)
tree8a628eaafc91872fb38f65a18c3230315039a74e
parent2dedad61769344f629b31479e936ee3ea05a8ccb (diff)
downloadmy_new_personal_website-21803814bc2d30660fe7e83fb6894c37ea886201.tar.xz
my_new_personal_website-21803814bc2d30660fe7e83fb6894c37ea886201.zip
Adds parameter for left aligned pullquotes, fixes #215
-rw-r--r--.themes/classic/sass/base/_typography.scss5
-rw-r--r--plugins/pullquote.rb12
2 files changed, 9 insertions, 8 deletions
diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss
index f248c2e4..60556752 100644
--- a/.themes/classic/sass/base/_typography.scss
+++ b/.themes/classic/sass/base/_typography.scss
@@ -115,7 +115,8 @@ blockquote {
}
}
-.pullquote-right:before, .pullquote-left:before {
+.pullquote-right:before,
+.pullquote-left:before {
/* Reset metrics. */
padding: 0;
border: none;
@@ -136,11 +137,9 @@ blockquote {
}
.pullquote-left:before {
-
/* Make left pullquotes align properly. */
float: left;
margin: .5em 1.5em 1em 0;
-
}
/* @extend this to force long lines of continuous text to wrap */
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 @@
# <p>
# <span data-pullquote="pullquotes are merely visual in presentation and should not appear twice in the text.">
# 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.
# </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
+# {% 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
- "<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.
+ "<span class='pullquote-#{@align}' data-pullquote='#{@quote}'>#{output.join.gsub(/\{"\s*|\s*"\}/, '')}</span>"
else
return "Surround your pullquote like this {\" text to be quoted \"}"
end