-
-
Save sandeshdamkondwar/cb24bae6422e6a4553ba to your computer and use it in GitHub Desktop.
This file contains 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
module Jekyll | |
class GooglePlusEmbedTag < Liquid::Tag | |
@post = nil | |
@height = '' | |
@width = '' | |
def initialize(tag_name, markup, tokens) | |
if markup =~ /(https:\/\/plus.google.com\/\d+\/posts\/\w+)/i | |
@url = $1 | |
end | |
super | |
end | |
def render(context) | |
"<div align='center'><div class='g-post' data-href='#{@url}'></div></div>" | |
end | |
end | |
end | |
Liquid::Template.register_tag('google_plus', Jekyll::GooglePlusEmbedTag) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment