Skip to content

Commit c15023c

Browse files
update comment plugin
1 parent 79bf049 commit c15023c

File tree

3 files changed

+29
-82
lines changed

3 files changed

+29
-82
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@
3939
4040
### 需要配置的内容:
4141
42-
1. 修改_config.yml中的信息(知乎等帐号,特别需要注意的是多说评论插件的id必须更换,否则您将不能查看到博客的评论)。
42+
1. 修改_config.yml中的信息(知乎等帐号,特别需要注意的是网易云跟贴(cloud_tie_public_key)必须更换,否则您将不能查看到博客的评论)。
4343
2. 修改about/index.html中个人信息(如果不需要个人简介,可以在步骤3中去除对应标签)。
4444
3. 修改_include/nav.html,选择自己需要的导航标签(主页, 应用, 标签, 关于等)
4545
4. 如果博客底部的github,知乎等需要修改,请编辑_includes/footer.html中分享的信息。
4646
4747
### 更新内容:
4848
49+
#### 2017-04-05
50+
51+
- 调整_config部分配置。
52+
- 由于多说即将关闭,评论组件调整为网易云跟贴。
53+
4954
#### 2017-02-19
5055
5156
- 修正文章双滚动条

_config.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ url: "http://127.0.0.1"
77
description: "编码生涯的点点滴滴"
88
github_username: androiddevelop
99
zhihu_username: codeboy
10-
duoshuo_id: androiddevelop
10+
cloud_tie_public_key: "\"7a06774f1f184badbb64d9af7c3d5c2c\""
11+
##########################上述信息需要您修改,cloud_tie_public_key两侧必须有引号############################
1112

12-
##########################上述信息需要您修改########3####################
1313

1414
# Where things are
1515
source: .
@@ -69,19 +69,20 @@ rdiscount:
6969
redcarpet:
7070
extensions: []
7171

72+
# Markdown Processors
7273
kramdown:
7374
auto_ids: true
7475
footnote_nr: 1
7576
entity_output: as_char
7677
toc_levels: 1..6
7778
smart_quotes: lsquo,rsquo,ldquo,rdquo
78-
enable_coderay: false
79+
syntax_highlighter: true
7980
input: GFM
8081

81-
coderay:
82-
coderay_wrap: div
83-
coderay_line_numbers: inline
84-
coderay_line_number_start: 1
85-
coderay_tab_width: 4
86-
coderay_bold_every: 10
87-
coderay_css: style
82+
syntax_highlighter_opts:
83+
wrap: div
84+
line_numbers: inline
85+
line_number_start: 1
86+
tab_width: 4
87+
bold_every: 10
88+
css: style

_layouts/post.html

Lines changed: 12 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -37,77 +37,18 @@ <h2 class="subheading">{{ page.subtitle }}</h2>
3737

3838
<hr>
3939

40-
41-
<!-- 多说 Share start -->
42-
<style>
43-
.ds-share{
44-
text-align: right;
45-
}
46-
/* 移动端暂时不显示 */
47-
@media only screen and (max-width: 700px) {
48-
.ds-share {
49-
50-
}
51-
}
52-
</style>
53-
54-
<div class="ds-share"
55-
data-thread-key="{{page.id}}" data-title="{{page.title}}"
56-
data-images="{{ site.url }}/{% if page.header-img %}{{ page.header-img }}{% else %}{{ site.header-img }}{% endif %}"
57-
data-content="{{ content | strip_html | truncate:80 }} | 小胖轩,玄恒 的个人博客"
58-
data-url="{{site.url}}{{page.url}}">
59-
<div class="ds-share-inline">
60-
<ul class="ds-share-icons-16">
61-
62-
<li data-toggle="ds-share-icons-more"><a class="ds-more" href="#">分享到:</a></li>
63-
<li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
64-
<li><a class="ds-weibo flat" href="javascript:void(0);" data-service="weibo">微博</a></li>
65-
<li><a class="ds-douban flat" href="javascript:void(0);" data-service="douban">豆瓣</a></li>
66-
</ul>
67-
<div class="ds-share-icons-more">
68-
</div>
69-
</div>
70-
<hr>
71-
</div>
72-
<!-- 多说 Share end-->
73-
74-
75-
<ul class="pager">
76-
{% if page.previous.url %}
77-
<li class="previous">
78-
<a href="{{ page.previous.url | prepend: site.baseurl | replace: '//', '/' }}" data-toggle="tooltip" data-placement="top" title="{{page.previous.title}}">&larr; 上一篇</a>
79-
</li>
80-
{% endif %}
81-
{% if page.next.url %}
82-
<li class="next">
83-
<a href="{{ page.next.url | prepend: site.baseurl | replace: '//', '/' }}" data-toggle="tooltip" data-placement="top" title="{{page.next.title}}">下一篇 &rarr;</a>
84-
</li>
85-
{% endif %}
86-
</ul>
87-
88-
<!-- 多说评论框 start -->
89-
<div class="comment">
90-
<div class="ds-thread" data-thread-key="{{page.id}}" data-title="{{page.title}}" data-url="{{site.url}}{{page.url}}"></div>
91-
</div>
92-
<!-- 多说评论框 end -->
93-
</div>
40+
<!-- 网易评论框 start -->
41+
<div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
42+
<script>
43+
var cloudTieConfig = {
44+
url: document.location.href,
45+
sourceId: "",
46+
productKey: {{site.cloud_tie_public_key}},
47+
target: "cloud-tie-wrapper"
48+
};
49+
</script>
50+
<script src="https://img1.cache.netease.com/f2e/tie/yun/sdk/loader.js"></script>
51+
<!-- 网易评论框 end -->
9452
</div>
9553
</div>
9654
</article>
97-
98-
99-
100-
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
101-
<script type="text/javascript">
102-
var duoshuoQuery = {short_name:"{{site.duoshuo_id}}"};
103-
(function() {
104-
var ds = document.createElement('script');
105-
ds.type = 'text/javascript';ds.async = true;
106-
ds.src = '//static.duoshuo.com/embed.js';
107-
ds.charset = 'UTF-8';
108-
(document.getElementsByTagName('head')[0]
109-
|| document.getElementsByTagName('body')[0]).appendChild(ds);
110-
})();
111-
</script>
112-
<!-- 多说公共JS代码 end -->
113-

0 commit comments

Comments
 (0)