Comments (5)
@lianghuiyuan
这是官方说明文档:
<!-- 多说评论框 start -->
<div class="ds-thread"
data-thread-key="请将此处替换成文章在你的站点中的ID"
data-title="请替换成文章的标题"
data-url="请替换成文章的网址">
</div>
<!-- 多说评论框 end -->
我的做法如下,另外还增加了一个热评文章链接:
{% if site.duoshuo_username %}
<!-- 多说评论框 start -->
<div class="comment">
<div class="ds-thread"
data-thread-key="{{page.id}}"
data-title="{{page.title}}"
data-url="{{site.url}}{{site.BASE_PATH}}{{page.url}}" >
</div>
<!-- 多说热评文章 end -->
<div class="ds-top-threads" data-range="monthly" data-num-items="5"></div>
</div>
<!-- 多说评论框 end -->
{% endif %}
注意:我这里的 site.BASE_PATH
是自己的定义的变量,等同于模板里面的site.baseurl
.
关于 data-thread-key 看这里解释 http://dev.duoshuo.com/docs/5003ecd94cab3e7250000008
关于 page.id 看这里:http://jekyllcn.com/docs/variables/
于是的每篇文章的thread-key都不会相同,方便了以后评论迁移及管理。
你可以可以参考我的blog 欢迎评论测试。http://brucezhaor.github.io
下面是多说后台管理,我理解的thread-key就是每篇文章的唯一标识,不知道是否正确,还请高人指正。
希望能够帮助你。:smile:
from huxpro.github.io.
@BruceZhaoR 如问题中描述的,data-thread-id="1187623191091085319"这个data-thread-id是什么ID呢,如何获取?
from huxpro.github.io.
由于当时多说数据库迁移的问题,我的评论有部分丢失,所以使用 id 强行索引回来的。
你并不需要使用这个 id,正常情况下,使用 key 就可以与其它文章区分了
关于 data-thread-key
, 具体可以参见 @BruceZhaoR 的回答~(感谢 @BruceZhaoR )
from huxpro.github.io.
请仔细你看我的回答和下面的 多说 官方链接-关于thread-key的。反正我的方法是能用的,Hux的ID我也不清楚怎么来的,你可以发邮件问他。
From BruceZhao's iPhone.
在2016年01月21日 21:52,Mr.L 写道:
@BruceZhaoR 如问题中描述的,data-thread-id="1187623191091085319"这个data-thread-id是什么ID呢,如何获取?
—
Reply to this email directly or view it on GitHub.
from huxpro.github.io.
Ok, 明白了,非常感谢两位解答。 @BruceZhaoR @Huxpro
from huxpro.github.io.
Related Issues (20)
- 下划线导致Mathjax公式渲染错误 HOT 1
- 文本和列表间的间距调整
- 同学,您这个项目引入了157个开源组件,存在1个漏洞,辛苦升级一下
- 在一个post里面,能引用其它的post吗? 类似html A标签 HOT 1
- Archive页面title更改之后文章不显示了 HOT 1
- All large image examples in GitHub Pages templates are broken HOT 1
- Add auto DarkMode/LightMode Switching Support HOT 1
- markdown图片路径是新浪相册路径时无法正常显示 HOT 2
- 如何关闭离线的功能 HOT 3
- 如何使用@font-face
- 请问如何触发的构建呢?
- nav bar center ?
- hidden : true 这个功能是干什么用的?
- How to change the size of home-page's intro-header-image?
- 图片的alt属性文本包含下划线时无法正确显示
- 文章生成目录的H1、H2级标题缩进不对 HOT 4
- 页面更新问题
- _posts文件夹下的文件名的要求 HOT 1
- Markdown problems
- 如何修改文章的字体大小
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 huxpro.github.io.