From 8897083cf7b90c0f8e08d0b0932eed2c3baf9684 Mon Sep 17 00:00:00 2001 From: strand Date: Tue, 11 Oct 2011 15:59:25 -0700 Subject: Implemented pullquoteleft functionality --- plugins/pullquote.rb | 8 +++++--- 1 file 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 @@ # #

# +# 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 - "#{output.join.gsub(/\{"\s*|\s*"\}/, '')}" + "#{output.join.gsub(/\{"\s*|\s*"\}/, '')}" # TODO Determine how to makethis span have a left or right flag. else return "Surround your pullquote like this {\" text to be quoted \"}" end -- cgit v1.2.1 From ce6604a15e61c1bf931b2d094c5cf30804414fa6 Mon Sep 17 00:00:00 2001 From: strand Date: Tue, 11 Oct 2011 16:09:38 -0700 Subject: Edited .themes/classic/sass/base/_typography.scss via GitHub --- .themes/classic/sass/base/_typography.scss | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss index ef83065b..d4b59ad0 100644 --- a/.themes/classic/sass/base/_typography.scss +++ b/.themes/classic/sass/base/_typography.scss @@ -115,7 +115,7 @@ blockquote { } } -.has-pullquote:before { +.has-pullquote:before, .has-pullquoteleft:before { /* Reset metrics. */ padding: 0; border: none; @@ -134,6 +134,15 @@ blockquote { font-size: 1.4em; line-height: 1.45em; } + +.has-pullquoteleft: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 */ .force-wrap { white-space: -moz-pre-wrap; -- cgit v1.2.1 From cae964e87513a5afc9763a83c21bbe59159d4acb Mon Sep 17 00:00:00 2001 From: B Strand Date: Wed, 12 Oct 2011 11:14:07 -0700 Subject: Updated pullquote.rb to use a vernacular similar to the image tag. --- plugins/pullquote.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/pullquote.rb b/plugins/pullquote.rb index 6d175e83..5dd6a553 100644 --- a/plugins/pullquote.rb +++ b/plugins/pullquote.rb @@ -17,13 +17,14 @@ # #

# -# 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. +# 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 =~ /align:left/i ? @align = "left" : @align = "" + markup =~ /left/i ? @align = "left" : @align = "right" super end @@ -31,7 +32,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*"\}/, '')}" # TODO Determine how to makethis span have a left or right flag. else return "Surround your pullquote like this {\" text to be quoted \"}" end -- cgit v1.2.1 From 490b2593ec8e912b042f49966a80c37f0026e0d9 Mon Sep 17 00:00:00 2001 From: B Strand Date: Wed, 12 Oct 2011 11:17:24 -0700 Subject: Renamed has-pullquote and has-pullquoteleft classes to pullquote-right and pullquote-left (I suppose a less stylistic naming convention might pullquote-default and pullquote-alternate.) --- .themes/classic/sass/base/_typography.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss index d4b59ad0..f248c2e4 100644 --- a/.themes/classic/sass/base/_typography.scss +++ b/.themes/classic/sass/base/_typography.scss @@ -115,7 +115,7 @@ blockquote { } } -.has-pullquote:before, .has-pullquoteleft:before { +.pullquote-right:before, .pullquote-left:before { /* Reset metrics. */ padding: 0; border: none; @@ -135,7 +135,7 @@ blockquote { line-height: 1.45em; } -.has-pullquoteleft:before { +.pullquote-left:before { /* Make left pullquotes align properly. */ float: left; -- cgit v1.2.1 From f6fb11a37571b48844c488bc351dd78747ee99bd Mon Sep 17 00:00:00 2001 From: B Strand Date: Wed, 12 Oct 2011 13:25:51 -0700 Subject: Added class='citation' to blockquotes generated by the blockquote plugin to differentiate their style from the style of an html or markdown blockquote. --- plugins/blockquote.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb index a0bf12cc..f4f57da3 100644 --- a/plugins/blockquote.rb +++ b/plugins/blockquote.rb @@ -71,7 +71,7 @@ module Jekyll else "#{quote}
#{author}
" end - "
#{blockquote}
" + "
#{blockquote}
" end def paragraphize(input) -- cgit v1.2.1 From 5b0486ced124c08ca017b20f584764bab4c5ff0e Mon Sep 17 00:00:00 2001 From: B Strand Date: Wed, 12 Oct 2011 13:28:58 -0700 Subject: Separated citation style from the general blockquote style. The general blockquote style is great for nesting and indentation, while the citation is excellent for quote attribution. --- .themes/classic/sass/base/_typography.scss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss index f248c2e4..ec99288c 100644 --- a/.themes/classic/sass/base/_typography.scss +++ b/.themes/classic/sass/base/_typography.scss @@ -96,13 +96,17 @@ small { font-size: .8em; } big { font-size: 1.2em; } -blockquote { +blockquote { $bq-margin: 1.2em; + padding-left: 1em; +} + +blockquote.citation { + font-style: italic; position: relative; font-size: 1.2em; - line-height: 1.5em; - padding-left: 1em; + line-height: 1.5em; border-left: 4px solid rgba($text-color-light, .5); cite { font-style: italic; -- cgit v1.2.1 From d983e3eb31cc80406a28ab566f78e52b90c56e93 Mon Sep 17 00:00:00 2001 From: B Strand Date: Thu, 13 Oct 2011 11:30:25 -0700 Subject: Reverted previous commit to separate that change to a different pull request. --- plugins/blockquote.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/blockquote.rb b/plugins/blockquote.rb index f4f57da3..a0bf12cc 100644 --- a/plugins/blockquote.rb +++ b/plugins/blockquote.rb @@ -71,7 +71,7 @@ module Jekyll else "#{quote}
#{author}
" end - "
#{blockquote}
" + "
#{blockquote}
" end def paragraphize(input) -- cgit v1.2.1 From 2e7bc43cf7d3d0b11381ad131baae870f64f2d71 Mon Sep 17 00:00:00 2001 From: B Strand Date: Thu, 13 Oct 2011 11:32:58 -0700 Subject: Reverted previous commit. --- .themes/classic/sass/base/_typography.scss | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.themes/classic/sass/base/_typography.scss b/.themes/classic/sass/base/_typography.scss index ec99288c..f248c2e4 100644 --- a/.themes/classic/sass/base/_typography.scss +++ b/.themes/classic/sass/base/_typography.scss @@ -96,17 +96,13 @@ small { font-size: .8em; } big { font-size: 1.2em; } -blockquote { +blockquote { $bq-margin: 1.2em; - padding-left: 1em; -} - -blockquote.citation { - font-style: italic; position: relative; font-size: 1.2em; - line-height: 1.5em; + line-height: 1.5em; + padding-left: 1em; border-left: 4px solid rgba($text-color-light, .5); cite { font-style: italic; -- cgit v1.2.1