Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加 utteranc 评论模块,在_config.yml 进行配置。 #405

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ disqus_username: hux
# Netease settings
netease_comment: false


# utteranc settings
# utteranc:
# enable: true
# repo: [username]/[repo]
# issue-term: pathname
# theme: github-light

# Analytics settings
# Baidu Analytics
Expand Down
4 changes: 3 additions & 1 deletion _doc/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,15 @@ iframe在不同的设备中,将会自动的调整大小。保留内边距是

#### Comment

博客不仅支持多说[Duoshuo](http://duoshuo.com)评论系统,也支持[Disqus](http://disqus.com)评论系统。
博客不仅支持多说[Duoshuo](http://duoshuo.com)评论系统,也支持[Disqus](http://disqus.com)评论系统和[utteranc](https://utteranc.es/)评论系统。

`Disqus`优点是:国际比较流行,界面也很大气、简介,如果有人评论,还能实时通知,直接回复通知的邮件就行了;缺点是:评论必须要去注册一个disqus账号,分享一般只有Facebook和Twitter,另外在墙内加载速度略慢了一点。想要知道长啥样,可以看以前的版本点[这里](http://brucezhaor.github.io/about.html) 最下面就可以看到。

`多说` 优点是:支持国内各主流社交软件(微博,微信,豆瓣,QQ空间 ...)一键分享按钮功能,另外登陆比较方便,管理界面也是纯中文的,相对于disqus全英文的要容易操作一些;缺点是:就是界面丑了一点。
当然你是可以自定义界面的css的,详情请看多说开发者文档 http://dev.duoshuo.com/docs/5003ecd94cab3e7250000008 。

`utteranc` 优点是: 基于github issues, 能访问github就能使用;缺点是:当路径为中文时,在github里生成的issues标题是UrlEncode过的。

**首先**,你需要去注册一个账号,不管是disqus还是多说的。**不要直接使用我的啊!**

**其次**,你只需要在下面的yaml头文件中设置一下就可以了。
Expand Down
13 changes: 13 additions & 0 deletions _includes/utteranc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% if site.utteranc.enable %}
<script src="https://utteranc.es/client.js"
repo="{{site.utteranc.repo}}"
issue-term="{{site.utteranc.issue-term}}"
theme="{{site.utteranc.theme}}"
crossorigin="anonymous"
async>
</script>

<!-- utteranc 评论框 start -->
<div id="utteranc-wrapper" class="utterances"></div>
<!-- utteranc 评论框 end -->
{% endif %}
4 changes: 4 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
<div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
<!-- 网易云跟帖 评论框 end -->
{% endif %}

<!-- utteranc 评论框 start -->
{% include utteranc.html %}
<!-- utteranc 评论框 end -->
</div>

<!-- Side Catalog Container -->
Expand Down