GithubHelp home page GithubHelp logo

Comments (6)

ppoffice avatar ppoffice commented on July 2, 2024 1

I think I found the problem: your are using relative disqus_url in your post. According to https://help.disqus.com/customer/portal/articles/472007-i-m-receiving-the-message-%22we-were-unable-to-load-disqus-%22, disqus_url must use an absolute URL; relative URLs won’t work. E.g., so you need to edit your Disqus config and add http:// before your site url.

from hexo-theme-minos.

ppoffice avatar ppoffice commented on July 2, 2024

Which _config.yml did you put disqus_shortname:shawlang in? I think the problem may have something to do with your config. And the Disqus script is in the after-footer.ejs, you can compare it to your universal code to find out the differences that may help to solve the problem.

from hexo-theme-minos.

shawlang avatar shawlang commented on July 2, 2024

I put it into the global _config.yml.(not into themes/_config.yml).
I compared the universal code to the code of after-footer.ejs. They are almost the same. I cannot figure it out.

1. after-footer.ejs
<script>
  var disqus_shortname = '<%= config.disqus_shortname %>';
  <% if (page.permalink){ %>
  var disqus_url = '<%= page.permalink %>';
  <% } %>
  (function(){
    var dsq = document.createElement('script');
    dsq.type = 'text/javascript';
    dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/<% if (page.comments) { %>embed.js<% } else { %>count.js<% } %>';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  })();
</script> 
2. universal code
 <div id="disqus_thread"></div>
  <script type="text/javascript">
    /* * * CONFIGURATION VARIABLES * * */
    var disqus_shortname = 'shawlang';

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
        var dsq = document.createElement('script'); dsq.type = 

'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || 

document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script> 

from hexo-theme-minos.

ppoffice avatar ppoffice commented on July 2, 2024

screenshot
Please add var disqus_developer = 1; to the original after-footer.ejs Disqus script and see if anything changes, or you may want to check your Disqus site config to see if there exists any block rules.

from hexo-theme-minos.

shawlang avatar shawlang commented on July 2, 2024

nothing changed. It exists the same error.This is my blog website : shawlang.github.io

There're no special block rules here : Disqus universal code

from hexo-theme-minos.

shawlang avatar shawlang commented on July 2, 2024

Thanks. You are right. But I fixed the problem by rewrite the URL in the global _config.yml of Hexo,not edited it in the Disqus config.

correct:

url: http://shawlang.github.io

incorrect:

url: shawlang.github.io

That can be explained:

var disqus_url = '<%= page.permalink %>';

In fact, disqus_url needs the absolute link which consists of http://,and the prefix of page.permalink is provided by global _config.yml. So if the prefix is right,disqus_url will be right.

Thanks again for not only helping me fix the problem but also stand bad English! 😄

from hexo-theme-minos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.