aboutsummaryrefslogtreecommitdiff
path: root/source/_includes/disqus_hook.haml
diff options
context:
space:
mode:
Diffstat (limited to 'source/_includes/disqus_hook.haml')
-rw-r--r--source/_includes/disqus_hook.haml11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/_includes/disqus_hook.haml b/source/_includes/disqus_hook.haml
new file mode 100644
index 00000000..60e2d3d9
--- /dev/null
+++ b/source/_includes/disqus_hook.haml
@@ -0,0 +1,11 @@
+:javascript
+ (function() {
+ var links = document.getElementsByTagName('a');
+ var query = '?';
+ for(var i = 0; i < links.length; i++) {
+ if(links[i].href.indexOf('#disqus_thread') >= 0) {
+ query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
+ }
+ }
+ document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/#{page.disqus_short_name}/get_num_replies.js' + query + '"></' + 'script>');
+ })(); \ No newline at end of file