Skip to content

Instantly share code, notes, and snippets.

@sandeshdamkondwar
Forked from MichaelEvans/google_plus.rb
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandeshdamkondwar/cb24bae6422e6a4553ba to your computer and use it in GitHub Desktop.
Save sandeshdamkondwar/cb24bae6422e6a4553ba to your computer and use it in GitHub Desktop.
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