From f77db80077d739077becc1618b87818ea42f145c Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 19 Jun 2011 15:14:01 -0400 Subject: 1. Switched back to Rdiscount 2. Improved Blockquote comment header 3. Added Include File and Pullquote plugins 4. Improved blog typography 5. Simplified "Read more" link --- themes/classic/_plugins/pullquote.rb | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 themes/classic/_plugins/pullquote.rb (limited to 'themes/classic/_plugins/pullquote.rb') diff --git a/themes/classic/_plugins/pullquote.rb b/themes/classic/_plugins/pullquote.rb new file mode 100644 index 00000000..2b8544ab --- /dev/null +++ b/themes/classic/_plugins/pullquote.rb @@ -0,0 +1,42 @@ +# +# Author: Brandon Mathis +# Based on the sematic 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 %} +# 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. +# {% endpullquote %} +# ...will output... +#

+# +# 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. +# +#

+# + +module Jekyll + + class PullquoteTag < Liquid::Block + PullQuoteMarkup = /\{(.+)\}/i + + def initialize(tag_name, markup, tokens) + super + end + + def render(context) + output = super + if output.join =~ /\{"\s*(.+)\s*"\}/ + @quote = $1 + "#{output.join.gsub(/\{"\s*|\s*"\}/, '')}" + else + return "Surround your pullquote like this {! text to be quoted !}" + end + end + end +end + +Liquid::Template.register_tag('pullquote', Jekyll::PullquoteTag) -- cgit v1.2.1