Comments (6)
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.
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.
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.
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.
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.
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:
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)
- Change the font? HOT 2
- '<' and '>' in code blocks will occur an error
- Using Netlify to deploy, Insight Search Chinese garbled. HOT 3
- How to change default renderer HOT 2
- 设置toc为true后,文章导航栏中文显示乱码 HOT 8
- a problem with the table presentation in markdown document HOT 2
- I Can't use Tag Plugin HOT 5
- show info. on every page with google-analytics data HOT 8
- [Feature Request] Make a table sortable HOT 1
- 本地启动后样式失效了 HOT 5
- Comment GitTalk Support
- gallery relate HOT 1
- [Configuration] Multi Language Suppport HOT 8
- Error when generating static files with Hexo 5.4.0 HOT 4
- [Feature Request] Add visit number
- render errors HOT 1
- [feature request] dark mode
- 搜索按钮出现在导航栏,但搜索页面出现在底部 HOT 10
- Is there full source code regarding to the theme example? 有没有主题文档那个例子的源码? HOT 4
- gallery插件问题 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-minos.