NEXT主题:使用”多说“给博客的文章添加评论功能
2017-09-05 23:00
579 查看
使用next主题:
1、下载next: git clone https://github.com/iissnan/hexo-theme-next themes/next
2、修改配置:
theme:next
使用”多说“给博客的文章添加评论功能:(附加:我是微信登录的)
1、在多说网站新建一个站点,并且获取一个多说域名,我填写的是yuzhiyun,然后填写需要使用评论功能的域名,我填写的是http://www.yuzhyun.me/
2、在多说网站的后台的“工具”tab 下获取到通用代码:
[java]
view plain
copy
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="请将此处替换成文章在你的站点中的ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"yuzhiyun"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
3、找到本地theme下你正在使用的hexo主题,我的是next, 打开F:\hexo\themes\next目录下的_config.yml配置文件,找到
4、修改F:\hexo\themes\next\layout\_partials目录下的comment.swing文件,把在dushuo网站上获取的通用代码黏贴到{%
if page.comments %} 和{% endif %}之间。同时需要再修改一点,把
[java]
view plain
copy
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="请将此处替换成文章在你的站点中的ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"></div>
替换成:
[java]
view plain
copy
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="<%- page.path %>" data-title="<%- page.title %>" data-url="<%- page.permalink %>"></div>
<!-- 多说评论框 end -->
5、更新到github
效果如图:
1、下载next: git clone https://github.com/iissnan/hexo-theme-next themes/next
2、修改配置:
_config.yml配置项
theme:
theme:next
使用”多说“给博客的文章添加评论功能:(附加:我是微信登录的)
1、在多说网站新建一个站点,并且获取一个多说域名,我填写的是yuzhiyun,然后填写需要使用评论功能的域名,我填写的是http://www.yuzhyun.me/
2、在多说网站的后台的“工具”tab 下获取到通用代码:
[java]
view plain
copy
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="请将此处替换成文章在你的站点中的ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"yuzhiyun"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
3、找到本地theme下你正在使用的hexo主题,我的是next, 打开F:\hexo\themes\next目录下的_config.yml配置文件,找到
duoshuo_shortname标签,设置为刚才创建站点时
多说域名中的内容,请注意,没有前缀
http://和后缀
.duoshuo.com. ,比如我的就是yuzhiyun
4、修改F:\hexo\themes\next\layout\_partials目录下的comment.swing文件,把在dushuo网站上获取的通用代码黏贴到{%
if page.comments %} 和{% endif %}之间。同时需要再修改一点,把
[java]
view plain
copy
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="请将此处替换成文章在你的站点中的ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"></div>
替换成:
[java]
view plain
copy
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="<%- page.path %>" data-title="<%- page.title %>" data-url="<%- page.permalink %>"></div>
<!-- 多说评论框 end -->
5、更新到github
效果如图:
相关文章推荐
- hexo使用next主题,并且使用”多说“给博客的文章添加评论功能
- Hexo + yilia 主题 +githubpages博客添加友言评论功能
- 为NexT主题添加文章阅读量统计功能
- 为个人博客添加文章评论功能
- 使用静态化技术写了一个用于在手机上看的博客系统(目前只能看文章,写不了评论)
- 给hexo个人博客 next主题添加背景图片
- 用 Flask 来写个轻博客 (30) — 使用 Flask-Admin 增强文章管理功能
- Hexo博客主题NexT使用自定义的CSS样式
- Django1.6学习--为博客添加comments(评论)功能
- 博客项目实现文章评论功能
- 在Web微信应用中使用博客园RSS以及Quartz.NET实现博客文章内容的定期推送功能
- Hexo个人免费博客(三) next主题、评论、阅读量统计和站内搜索
- 为Next主题添加多说评论系统
- Ajax 和 XML: 使用 Ajax 实现打分评级和添加评论功能
- 博客项目实现文章评论功能(重点是评论回复)
- 用flask开发个人博客(37)—— 使用Flask-pagedown实现博客文章预览的功能
- Django博客功能实现—文章评论的显示
- 地址主题java项目中添加邮件发送功能(使用apache commons mail开源项目)
- 博客项目实现文章评论功能(重点是评论回复)
- 织梦文章评论功能的使用