From d3b21b5649a729a35a0bdb1c1d64278e6c9b05d5 Mon Sep 17 00:00:00 2001 From: ElderJames Date: Thu, 7 Jun 2018 00:35:01 +0800 Subject: [PATCH 1/2] fix(gitalk): fix issue #622 --- layout/_widget/comment/gitalk/main.ejs | 27 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/layout/_widget/comment/gitalk/main.ejs b/layout/_widget/comment/gitalk/main.ejs index ff346681d..6e7b4e5fd 100644 --- a/layout/_widget/comment/gitalk/main.ejs +++ b/layout/_widget/comment/gitalk/main.ejs @@ -4,16 +4,25 @@ + \ No newline at end of file From c3ad6f45fb5f4551db40fe62b597ac65ed2efc35 Mon Sep 17 00:00:00 2001 From: ElderJames Date: Thu, 7 Jun 2018 00:56:01 +0800 Subject: [PATCH 2/2] fix(gitalk): add 'gitalk' triggle to use md5 for the id --- layout/_widget/comment/gitalk/main.ejs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layout/_widget/comment/gitalk/main.ejs b/layout/_widget/comment/gitalk/main.ejs index 6e7b4e5fd..a51493add 100644 --- a/layout/_widget/comment/gitalk/main.ejs +++ b/layout/_widget/comment/gitalk/main.ejs @@ -10,10 +10,14 @@ var id = location.pathname; if (Date.parse('<%= page.date %>') - Date.parse('2018-03-01') > 0 || - '<%= typeof page["gitalk"]!=="undefined"?"true":"false" %>' !== 'true') { + '<%= page.gitalk =="md5" ?"true":"false" %>' === 'true') { id = md5(location.pathname) } + if ('<%= page.gitalk =="plaintext"?"true":"false" %>' === 'true') { + id = location.pathname; + } + var gitalk = new Gitalk({ clientID: '<%= theme.comment.gitalk_client_id %>', clientSecret: '<%= theme.comment.gitalk_client_secret %>',