迁移原因

1
2
3
重要通知: 多说即将关闭
多说网 发表于 3月21日
因公司业务调整,非常遗憾的向大家宣布多说项目即将关闭。 我们将于2017年6月1日正式关停服务,在此之前您可以通过后台的数据导出功能导出自己站点的评论数据。 对此给您造成的不便,我们深表歉意,感谢您的一路相伴。

修改相应代码

1. 修改文章底部评论框post.jade

留言框主要在文章的内容页,所以要替换留言处相应的代码。

你可能会发现如下的调用代码:

1
2
#comments
include _partial/comments

再到模板目录下的_partial目录修改comments.jade

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
if theme.duoshuo
.ds-thread(data-thread-key=page.path, data-title=page.title, data-url=page.permalink, data-author-key='1')

if theme.disqus
#disqus_thread

if theme.youyan
<div id="uyan_frame">
script(type='text/javascript' src='//v2.uyan.cc/code/uyan.js?uid=#{theme.youyan}')
</div>

if theme.yungentie
<div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
script(type="text/javascript").
var cloudTieConfig = {
url: document.location.href,
sourceId: "",
productKey: "cb283a9f048249cf8c427834214ebaaf",
target: "cloud-tie-wrapper"
};
script(type='text/javascript' src='//img1.cache.netease.com/f2e/tie/yun/sdk/loader.js')

2. 修改文章内容页评论参与数

hexo-guestbook

1
2
3
4
5
6
7
8
9
10
11
if theme.duoshuo
a.ds-thread-count(data-thread-key=page.path, href=url_for(page.path) + '#comments')
if theme.disqus
a.disqus-comment-count(data-disqus-identifier=page.path, href=url_for(page.path) + '#disqus_thread')
if theme.yungentie
<div class="ds-thread-count">
<a class="cloud-tie-join-count" href="javascript:void(0);" >
<span class="join-count" data-url=page.path >0</span>
<span class="join-text">评论</span>
</a>
</div>

3. 修改page.jade

如果你的博客在关于我页面也存在留言板,可以修改相应的单页模板。

1
2
3
if page.comments
#comments
include _partial/comments

发现我的这个页面的模板也是调用的单独的评论页模板。

遗憾

首页的文章评论数无法显示

我调试了很久都无法实现,如果您刚好实现了这个功能请分享给我,谢谢啦。

首页的最近评论列表无法调用

网易云跟帖无此功能~…