imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.32k stars 2.62k forks source link

Disqus comments were not connecting #633

Open chriscowley opened 12 years ago

chriscowley commented 12 years ago

Symptom in the title.

Appears to me that the code in source/_includes/discus.html was out of date. I replaced it with what is currently on disqus and my comments have sprung to life:

@@ -1,21 +1,17 @@
 {% comment %} Load script if disquss comments are enabled and `page.comments` is either empty (index) or set to true {% endcomment %}
 {% if site.disqus_short_name and page.comments != false %}
-<script type="text/javascript">
-      var disqus_shortname = '{{ site.disqus_short_name }}';
-      {% if page.comments == true %}
-        {% comment %} `page.comments` can be only be set to true on pages/posts, so we embed the comments here. {% endcomment %}
-        // var disqus_developer = 1;
-        var disqus_identifier = '{{ site.url }}{{ page.url }}';
-        var disqus_url = '{{ site.url }}{{ page.url }}';
-        var disqus_script = 'embed.js';
-      {% else %}
-        {% comment %} As `page.comments` is empty, we must be on the index page. {% endcomment %}
-        var disqus_script = 'count.js';
-      {% endif %}
-    (function () {
-      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
-      dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
-      (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
-    }());
-</script>
+        <div id="disqus_thread"></div>
+        <script type="text/javascript">
+            /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+            var disqus_shortname = '{{ site.disqus_short_name }}'; // required: replace example with your forum shortname
+
+            /* * * DON'T EDIT BELOW THIS LINE * * */
+            (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);
+            })();
+        </script>
+        <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+        <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
 {% endif %}
zekus commented 12 years ago

that is not the issue. the code is up to date but for some reason 'page.comments' is always empty so the script thinks that he's on the index page

zekus commented 12 years ago

check in your source/_posts/yourpost.markdown that you have "comments: true"

skatkov commented 12 years ago

"source/_posts/yourpost.markdown that you have "comments: true"" somehow i tried this before this post and it worked.

stardiviner commented 11 years ago

I have same issue, the disqus does now show up. I checked, comments: true in source/_posts/post.markdown. And checked disqus_short_name: NAME in _config.yml.

stardiviner commented 11 years ago

solved, Here the disqus is blocked.