报错原因:因为 github 对 Issues label 的长度有了要求,如果超过 50 个字符串则会报错.
解决方案:
定位到博客主题中的 gitalk.ejs 文件
1 2 3 4 5 6 7 8 9 10 11 12 13
| const gitalk = new Gitalk({ clientID: "<%= theme.gitalk.clientID %>", clientSecret: "<%= theme.gitalk.clientSecret %>", repo: "<%= theme.gitalk.repo %>", owner: "<%= theme.gitalk.owner %>", id: location.pathname, admin: ["<%= theme.gitalk.admin %>"], distractionFreeMode: false, });
|
思路是对 id 进行 md5 加密
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <script src="https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.16.0/js/md5.min.js"></script>;
var id = md5(window.location.pathname).toUpperCase(); const gitalk = new Gitalk({ clientID: "<%= theme.gitalk.clientID %>", clientSecret: "<%= theme.gitalk.clientSecret %>", repo: "<%= theme.gitalk.repo %>", owner: "<%= theme.gitalk.owner %>", id: id, admin: ["<%= theme.gitalk.admin %>"], distractionFreeMode: false, });
|
重新发布,重建 Issues,问题解决