This repository was archived by the owner on Jun 4, 2022. It is now read-only.
Commit 131b7e9 ppoffice
committed Jan 8, 2019
1 parent 5ab7538 commit 131b7e9 Copy full SHA for 131b7e9
File tree 5 files changed +42
-2
lines changed
5 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ comment:
75
75
avatar: identicon # (''/mm/identicon/monsterid/wavatar/retro/hide), more to see https://valine.js.org/avatar/
76
76
avatar_cdn: https://gravatar.loli.net/avatar/ # avatar CDN address, default gravatar.loli.net
77
77
pageSize: 10 # comments of one page
78
+ gitalk:
79
+ on: # enter true to enable gitalk
80
+ owner: # GitHub user name
81
+ repo: # GitHub repository name
82
+ client_id: # OAuth application client id
83
+ client_secret: # OAuth application client secret
84
+ admin: # GitHub repo owner and collaborators who can initialize github issues
85
+ # Can either be a string or an array.
78
86
79
87
# Share
80
88
share: default # options: jiathis, bdshare, addtoany, default
Original file line number Diff line number Diff line change
1
+ <% if (typeof (script) !== ' undefined' && script) { % >
2
+ < link rel= " stylesheet" href= " https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css" >
3
+ < script src= " https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js" >< / script>
4
+ < script>
5
+ var gitalk = new Gitalk ({
6
+ clientID: ' <%= theme.comment.gitalk.client_id %>' ,
7
+ clientSecret: ' <%= theme.comment.gitalk.client_secret %>' ,
8
+ id: ' <%= md5(page.path) %>' ,
9
+ repo: ' <%= theme.comment.gitalk.repo %>' ,
10
+ owner: ' <%= theme.comment.gitalk.owner %>' ,
11
+ admin: < %- JSON .stringify (theme .comment .gitalk .admin )% >
12
+ })
13
+ gitalk .render (' comment-container' )
14
+ < / script>
15
+ < % } else { % >
16
+ < div id= " comment-container" >< / div>
17
+ < % } %>
Original file line number Diff line number Diff line change 10
10
< %- partial (' comment/livere' ) % >
11
11
< % } else if (theme .comment .facebook ) { % >
12
12
< %- partial (' comment/facebook' ) % >
13
- < % } else if (typeof (theme .comment .isso ) === ' string'
13
+ < % } else if (typeof (theme .comment .isso ) === ' string'
14
14
|| theme .comment .isso && theme .comment .isso .on ) { % >
15
15
< %- partial (' comment/isso' ) % >
16
16
< % } else if (theme .comment .changyan .on ) { % >
17
17
< %- partial (' comment/changyan' ) % >
18
18
< % } else if (theme .comment .valine .on ) { % >
19
19
< %- partial (' comment/valine' ) % >
20
+ < % } else if (theme .comment .gitalk .on ) { % >
21
+ < %- partial (' comment/gitalk' ) % >
20
22
< % } % >
21
23
< / section>
22
24
< % } %>
Original file line number Diff line number Diff line change 8
8
< %- partial (' comment/livere' , { script: true }) % >
9
9
< % } else if (theme .comment .facebook ) { % >
10
10
< %- partial (' comment/facebook' , { script: true }) % >
11
- < % } else if (typeof (theme .comment .isso ) === ' string'
11
+ < % } else if (typeof (theme .comment .isso ) === ' string'
12
12
|| theme .comment .isso && theme .comment .isso .on ) { % >
13
13
< %- partial (' comment/isso' , { script: true }) % >
14
14
< % } else if (theme .comment .changyan .on ) { % >
15
15
< %- partial (' comment/changyan' , { script: true }) % >
16
16
< % } else if (theme .comment .valine .on ) { % >
17
17
< %- partial (' comment/valine' , { script: true }) % >
18
+ < % } else if (theme .comment .gitalk .on ) { % >
19
+ < %- partial (' comment/gitalk' , { script: true }) % >
18
20
< % } %>
Original file line number Diff line number Diff line change
1
+ /**
2
+ * MD5 Hash Helper
3
+ * @description Calculate the MD5 hash value of a string
4
+ * @example
5
+ * <%- md5(data) %>
6
+ */
7
+ const crypto = require ( 'crypto' ) ;
8
+
9
+ hexo . extend . helper . register ( 'md5' , function ( data ) {
10
+ return crypto . createHash ( 'md5' ) . update ( data ) . digest ( "hex" ) ;
11
+ } ) ;
You can’t perform that action at this time.
1 commit comments
ppoffice commentedon Jan 8, 2019
#248