File tree Expand file tree Collapse file tree 9 files changed +64
-30
lines changed Expand file tree Collapse file tree 9 files changed +64
-30
lines changed Original file line number Diff line number Diff line change 6
6
7
7
## Table of Contents
8
8
9
- - [ How to use] (#How to use)
10
- - [ Install ] ( #Install )
11
- - [ Configuration Item ] (#Configuration Item )
12
- - [ Effect Preview ] (#Effect Preview )
13
- - [ update ] ( #update )
14
- - [ Portable Version ] (#Portable Version )
9
+ - [ How to use] ( #how-to- use )
10
+ - [ Installation ] ( #installation )
11
+ - [ Configuration items ] ( #configuration-items )
12
+ - [ Effect preview ] ( #effect-preview )
13
+ - [ Update ] ( #update )
14
+ - [ Porting version ] ( #porting-version )
15
15
- [ Todo] ( #todo )
16
- - [ Participation ] ( #Participation )
16
+ - [ Participate ] ( #participate )
17
17
- [ LICENCE] ( #licence )
18
18
19
19
Created by [ gh-md-toc] ( https://github.com/ekalinin/github-markdown-toc )
@@ -140,15 +140,23 @@ social:
140
140
- Comment module configuration
141
141
142
142
``` bash
143
- # Commend module
143
+ # comment module
144
144
comment:
145
145
enable: false # true to enable
146
+ type: valine # value: valine | utterances
147
+
148
+ # valine params
146
149
appId: your-app-id
147
150
appKey: your-app-key
148
151
placeholder: say something
149
152
notify: false
150
153
verify: false
151
154
avatar: mp
155
+
156
+ # utterances (https://utteranc.es/) params
157
+ repo: your github repo path which supports comment
158
+ issue_term: your issue term
159
+ theme: comment theme
152
160
```
153
161
154
162
- Open math formula
Original file line number Diff line number Diff line change 11
11
## 目录
12
12
13
13
- [ 如何使用] ( #如何使用 )
14
- - [ 安装] ( #安装 )
15
- - [ 配置项] ( #配置项 )
14
+ - [ 安装] ( #安装 )
15
+ - [ 配置项] ( #配置项 )
16
16
- [ 效果预览] ( #效果预览 )
17
17
- [ update] ( #update )
18
18
- [ 移植版] ( #移植版 )
@@ -144,15 +144,23 @@ social:
144
144
- 评论模块配置
145
145
146
146
``` bash
147
- # commend module
147
+ # comment module
148
148
comment:
149
- enable: false # true to enable
149
+ enable: false
150
+ type: valine # valine | utterances
151
+
152
+ # valine 需要的参数
150
153
appId: your-app-id
151
154
appKey: your-app-key
152
155
placeholder: say something
153
156
notify: false
154
157
verify: false
155
158
avatar: mp
159
+
160
+ # utterances (https://utteranc.es/) 需要的参数
161
+ repo: your-repo-name
162
+ issue_term: your-issue-term
163
+ theme: your-comment-theme
156
164
```
157
165
158
166
- 开启数学公式
Original file line number Diff line number Diff line change @@ -43,12 +43,20 @@ main_color: default # forest | grass | sky | sun | sea
43
43
# google Analytics
44
44
google_analytics_id : xx-xxxxxxx-xx
45
45
46
- # commend module
46
+ # comment module
47
47
comment :
48
48
enable : false
49
+ type : valine # valine | utterances
50
+
51
+ # valine 需要的参数
49
52
appId : your-app-id
50
53
appKey : your-app-key
51
54
placeholder : say something
52
55
notify : false
53
56
verify : false
54
57
avatar : mp
58
+
59
+ # utterances (https://utteranc.es/) 需要的参数
60
+ repo : your-repo-name
61
+ issue_term : your-issue-term
62
+ theme : your-comment-theme
Original file line number Diff line number Diff line change
1
+ case theme .comment .type
2
+ when ' valine'
3
+ include ./scripts/valine-comment
4
+ when ' utterances'
5
+ include ./scripts/utterances-comment
Original file line number Diff line number Diff line change 6
6
- if (is_category ()) pageTitle = ' Category: ' + page .category
7
7
- if (is_month ()) pageTitle += ' : ' + page .month + ' /' + page .year
8
8
- if (is_year ()) pageTitle += ' : ' + page .year
9
- - pageTitle += ' [ ' + config .title + ' ] '
9
+ - if (pageTitle == ' ' ) return config .title
10
+ - pageTitle += ' - ' + config .title
10
11
- return pageTitle
11
12
- }
12
13
@@ -57,7 +58,6 @@ html(lang=config.language)
57
58
script( src =url defer )
58
59
59
60
include ./scripts/google-analytics-script
60
- include ./scripts/comments-script
61
61
include ./scripts/toc-script
62
62
include ./scripts/math-script
63
63
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ script( src ="https://utteranc.es/client.js"
2
+ repo =` ${ theme .comment .repo } `
3
+ issue-term =` ${ theme .comment .issue_term } `
4
+ theme =` ${ theme .comment .theme } `
5
+ crossorigin ="anonymous" async )
Original file line number Diff line number Diff line change
1
+ #comments
2
+ script( src ="https://www.unpkg.com/valine/dist/Valine.min.js" defer )
3
+ script .
4
+ window .addEventListener (' DOMContentLoaded' , () => {
5
+ new Valine ({
6
+ el: ' #comments' ,
7
+ appId: ' #{theme.comment.appId}' ,
8
+ appKey: ' #{theme.comment.appKey}' ,
9
+ notify: #{theme .comment .notify },
10
+ verify: #{theme .comment .notify },
11
+ avatar: ' #{theme.comment.avatar}' ,
12
+ placeholder: ' #{theme.comment.placeholder}' ,
13
+ })
14
+ })
Original file line number Diff line number Diff line change @@ -19,6 +19,6 @@ block content
19
19
.main__bottom
20
20
include includes/pre-next.pug
21
21
if page .content && theme .comment && theme .comment .enable
22
- # comments
22
+ include includes/ comments
23
23
24
24
You can’t perform that action at this time.
0 commit comments