This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ppoffice
committed
Jan 8, 2019
1 parent
5ab7538
commit 131b7e9
Showing
5 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<% if (typeof(script) !== 'undefined' && script) { %> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script> | ||
<script> | ||
var gitalk = new Gitalk({ | ||
clientID: '<%= theme.comment.gitalk.client_id %>', | ||
clientSecret: '<%= theme.comment.gitalk.client_secret %>', | ||
id: '<%= md5(page.path) %>', | ||
repo: '<%= theme.comment.gitalk.repo %>', | ||
owner: '<%= theme.comment.gitalk.owner %>', | ||
admin: <%- JSON.stringify(theme.comment.gitalk.admin)%> | ||
}) | ||
gitalk.render('comment-container') | ||
</script> | ||
<% } else { %> | ||
<div id="comment-container"></div> | ||
<% } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* MD5 Hash Helper | ||
* @description Calculate the MD5 hash value of a string | ||
* @example | ||
* <%- md5(data) %> | ||
*/ | ||
const crypto = require('crypto'); | ||
|
||
hexo.extend.helper.register('md5', function (data) { | ||
return crypto.createHash('md5').update(data).digest("hex"); | ||
}); |
131b7e9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#248