mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-24 08:28:50 -05:00
Updated pullquote.rb to use a vernacular similar to the image tag.
This commit is contained in:
parent
ce6604a15e
commit
cae964e875
@ -17,13 +17,14 @@
|
|||||||
# </span>
|
# </span>
|
||||||
# </p>
|
# </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.
|
# 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
|
module Jekyll
|
||||||
|
|
||||||
class PullquoteTag < Liquid::Block
|
class PullquoteTag < Liquid::Block
|
||||||
def initialize(tag_name, markup, tokens)
|
def initialize(tag_name, markup, tokens)
|
||||||
markup =~ /align:left/i ? @align = "left" : @align = ""
|
markup =~ /left/i ? @align = "left" : @align = "right"
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ module Jekyll
|
|||||||
output = super
|
output = super
|
||||||
if output.join =~ /\{"\s*(.+)\s*"\}/
|
if output.join =~ /\{"\s*(.+)\s*"\}/
|
||||||
@quote = $1
|
@quote = $1
|
||||||
"<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.
|
"<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
|
else
|
||||||
return "Surround your pullquote like this {\" text to be quoted \"}"
|
return "Surround your pullquote like this {\" text to be quoted \"}"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user