Class: Octopress::Social::Disqus::Tag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/octopress-social/disqus.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag, input, tokens) ⇒ Tag

Returns a new instance of Tag.



70
71
72
73
# File 'lib/octopress-social/disqus.rb', line 70

def initialize(tag, input, tokens)
  @tag = tag.strip
  @input = input.strip
end

Instance Method Details

#render(context) ⇒ Object



75
76
77
78
79
80
81
82
# File 'lib/octopress-social/disqus.rb', line 75

def render(context)
  site   = context['site']
  item   = Octopress::Social.item(context, @input)

  Octopress::Social::Disqus.set_config(site)
  Octopress::Social::Disqus.set_url(site, item)
  Octopress::Social::Disqus.send(@tag, site, item).gsub(/(\s{2,}|\n)/, ' ').strip
end