File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ <h2 class="subheading">{{ page.subtitle }}</h2>
88
88
< link rel ="stylesheet " href ="https://unpkg.com/gitalk/dist/gitalk.css ">
89
89
< script src ="https://unpkg.com/gitalk@latest/dist/gitalk.min.js "> </ script >
90
90
< div id ="gitalk-container "> </ div >
91
+ <!-- 引入一个生产md5的js,用于对id值进行处理,防止其过长 -->
92
+ <!-- Thank DF:https://github.com/NSDingFan/NSDingFan.github.io/issues/3#issuecomment-407496538 -->
93
+ < script src ="{{ site.baseurl }}/js/md5.min.js "> </ script >
91
94
< script type ="text/javascript ">
92
95
var gitalk = new Gitalk ( {
93
96
clientID : '{{site.gitalk.clientID}}' ,
@@ -96,7 +99,7 @@ <h2 class="subheading">{{ page.subtitle }}</h2>
96
99
owner : '{{site.gitalk.owner}}' ,
97
100
admin : [ '{{site.gitalk.admin}}' ] ,
98
101
distractionFreeMode : { { site . gitalk . distractionFreeMode} } ,
99
- id : window . location . pathname ,
102
+ id : md5 ( location . pathname ) ,
100
103
} ) ;
101
104
gitalk . render ( 'gitalk-container' ) ;
102
105
</ script >
You can’t perform that action at this time.
0 commit comments