Created
February 17, 2014 23:59
-
-
Save pjf/9061813 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: {% pullquote : Here's some pullquote text. %} | |
module Jekyll | |
class PullQuote < Liquid::Tag | |
# (Options) : (Message) | |
Syntax = /^(.*?)\s*:\s*(.*)/ | |
def initialize(tag_name, markup, tokens) | |
super | |
if markup =~ Syntax then | |
@quote = $2 | |
else | |
raise "Failed to parse #{tag_name}: #{markup} #{tokens}" | |
end | |
end | |
def render(context) | |
markup = "<div class=\"pullquote\"><p><i class=\"fa fa-quote-left fa-2x pull-left\"></i> #{@quote} </p></div>" | |
puts(markup) | |
markup | |
end | |
end | |
end | |
Liquid::Template.register_tag('pullquote', Jekyll::PullQuote) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment