15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/alula/plugins/disqus.rb', line 15
def self.install(options)
return false unless options.shortname
Alula::Plugin.script(:post_bottom, ->(context) {
<<-EOS
var disqus_shortname = '#{options['shortname']}';
var disqus_identifier = '#{context.item.metadata. || context.item.slug}';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
EOS
}
)
end
|