首页 > jekyll使用多说的问题

jekyll使用多说的问题

为什么我配置好了多说,但是没有在博客上显示

这个是我在github上关于多说的配置

{% if site.duoshuo %}
    <div class="ds-thread" data-thread-key="{{ page.thread }}" data-url="{{ site.url }}{{ page.url }}" data-title="{{ page.title }}" />
    <script type="text/javascript">
    var duoshuoQuery = {short_name:"{{ site.duoshuo }}"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = 'http://static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
        || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
{% endif %}

这个是最后博客上面的html

<div id="ds-thread" class="ds-thread" data-title="Python3.x和Python2.x的区别" data-url="" data-thread-key="">
<script type="text/javascript">

    var duoshuoQuery = {short_name:"xumenger"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = 'http://static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
        || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    
</script>
<div id="ds-waiting"></div>

同样的,这个是别人的博客上面的html

<div id="ds-thread" class="ds-thread">
<script type="text/javascript">

    var duoshuoQuery = {short_name:"niushuai"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = 'http://static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
        || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    
</script>
<div id="ds-reset">
<div class="ds-meta">
<a class="ds-like-thread-button ds-rounded" href="javascript:void(0)">
<span class="ds-like-panel"></span>
</div>
<div class="ds-comments-info">
<div class="ds-sort">
<ul class="ds-comments-tabs">
</div>
<ul class="ds-comments">
<li class="ds-post ds-post-placeholder">沙发速度来抢啊...</li>
</ul>
<div class="ds-paginator" style="display: none;">
<a name="respond"></a>
<div class="ds-toolbar">
<div class="ds-account-control">
<div class="ds-visitor">
</div>
<div class="ds-replybox">
<a class="ds-avatar" title="设置头像" target="_blank" href="http://duoshuo.com/settings/avatar/">
<form method="post">
</div>
<p class="ds-powered-by">
<a rel="nofollow" target="_blank" href="http://duoshuo.com">飘过的小牛正在使用多说</a>
</p>
</div>
</div>

这段代码有4个地方要填
data-thread-key填上{{ page.id }}
data-title 填上 {{ page.title }}
data-url 填上 your web site/{{ page.url }}
short_name 注册多说账号的时候让你填的二级短域名

参考:http://www.ituring.com.cn/article/114888

【热门文章】
【热门文章】