Skip to content

Commit a06811f

Browse files
committed
feat(comment): change to gitalk
1 parent 1b0fbd5 commit a06811f

File tree

6 files changed

+15
-16
lines changed

6 files changed

+15
-16
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ In your swiftype engine, go to `Install Search`, you will find the `swiftype.sea
3131

3232
This service provides the comment function.
3333

34-
Service address: <https://github.com/imsun/gitment>.
34+
Service address: <https://github.com/gitalk/gitalk>.
3535

36-
After the setup is complete, you need to modify the `gitment` in `_config.yml`.
36+
After the setup is complete, you need to modify the `comment` in `_config.yml`.

README_zh_CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828

2929
此服务提供评论功能
3030

31-
服务地址:<https://github.com/imsun/gitment>
31+
服务地址:<https://github.com/gitalk/gitalk>
3232

33-
设置完毕后, 需要修改 `_config.yml` 中的 `gitment`
33+
设置完毕后, 需要修改 `_config.yml` 中的 `comment`

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ github:
3434
username: bit-ranger
3535
swiftype:
3636
searchId: iXZyPokVfxFaBTvi64Y6
37-
gitment:
37+
comment:
3838
repo: blog
3939
client_id: a6fb73b3e790e234bab8
4040
client_secret: cc10aaff53a03d05ab2ee002dbf401dd7627c7a3

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
1212
<script type="text/javascript" src="https://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
1313
<script type="text/javascript" src="{{'/static/js/script.js' | prepend:site.baseurl | prepend: site.url }}"></script>
14-
<script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.js"></script>
14+
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
1515
{% for script in page.scripts %}<script type="text/javascript" src="{{'/static/js/' | append:script | prepend:site.baseurl | prepend: site.url }}"></script>
1616
{%endfor%}

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css"/>
1414
<link rel="stylesheet" href="https://cdn.bootcss.com/octicons/3.5.0/octicons.min.css" >
1515
<link rel="stylesheet" type="text/css" href="{{ '/static/css/style.css' | prepend: site.baseurl | prepend: site.url}}" />
16-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.css"/>
16+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
1717
{% for style in page.styles %}<link rel="stylesheet" type="text/css" href="{{ '/static/css/' | append: style | prepend: site.baseurl | prepend: site.url}}" />
1818
{%endfor%}
1919

static/js/post.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$(document).ready(function() {
99
generateContent();
1010
// share();
11-
gitment();
11+
renderComment();
1212
});
1313

1414
/**
@@ -28,17 +28,16 @@ function share(){
2828
}
2929

3030

31-
function gitment() {
32-
var gitment = new Gitment({
31+
function renderComment() {
32+
var gittalk = new Gitalk({
3333
id: window.location.pathname,
34+
clientID: '{{site.comment.client_id}}',
35+
clientSecret: '{{site.comment.client_secret}}',
3436
owner: '{{site.github.username}}',
35-
repo: '{{site.gitment.repo}}',
36-
oauth: {
37-
client_id: '{{site.gitment.client_id}}',
38-
client_secret: '{{site.gitment.client_secret}}',
39-
},
37+
repo: '{{site.comment.repo}}',
38+
admin: ['{{site.github.username}}']
4039
});
41-
gitment.render('post-comment')
40+
gittalk.render('post-comment')
4241
$("#post-comment").removeClass('hidden');
4342
}
4443

0 commit comments

Comments
 (0)