Browse code

As other things rely on these variables, they need to be global. Fixes issues with comments not loading on the blog. Semicolons non-optional due to SAFE function http://twitter.com/#!/elijahmanor/status/121980870428069890

Drew Wells authored on 09/10/2011 at 07:14:27
Showing 1 changed files
... ...
@@ -1,19 +1,19 @@
1 1
 {% comment %} Load script if disquss comments are enabled and `page.comments` is either empty (index) or set to true {% endcomment %}
2 2
 {% if site.disqus_short_name and page.comments != false %}
3 3
 <script type="text/javascript">
4
-    (function () {
4
+    
5 5
       var disqus_shortname = '{{ site.disqus_short_name }}';
6 6
       {% if page.comments == true %}
7 7
         {% comment %} `page.comments` can be only be set to true on pages/posts, so we embed the comments here. {% endcomment %}
8 8
         // var disqus_developer = 1;
9 9
         var disqus_identifier = '{{ site.url }}{{ page.url }}';
10 10
         var disqus_url = '{{ site.url }}{{ page.url }}';
11
-        var disqus_script = 'embed.js'
11
+        var disqus_script = 'embed.js';
12 12
       {% else %}
13 13
         {% comment %} As `page.comments` is empty, we must be on the index page. {% endcomment %}
14
-        var disqus_script = 'count.js'
14
+        var disqus_script = 'count.js';
15 15
       {% endif %}
16
-
16
+    (function () {
17 17
       var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
18 18
       dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
19 19
       (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);