解决:gitalk 报错 Error: Validation Failed.--MD5 加密 id 避免 github issue lables 50 字符限制
创建一个github gist
文件保存
https://github.com/blueimp/JavaScript-MD5/blob/master/js/md5.min.js
js 源码:
https://gist.githubusercontent.com/qhh0205/78e9e0b1f3114db6737f3ed8cdd51d3a/raw/3894c5be5aa2378336b1f5ee0f296fa0b22d06e9/md5.min.js
将 gist 链接嵌入到 layout/_third-party/comments/gitalk.swig
文件,嵌入时的 js 链接地址需要注意下:
不能直接写第一步的创建的 gitst 链接地址,需要将 gist.githubusercontent.com
替换为 rawgit.com
。即嵌入地址为:
https://rawgit.com/qhh0205/78e9e0b1f3114db6737f3ed8cdd51d3a/raw/3894c5be5aa2378336b1f5ee0f296fa0b22d06e9/md5.min.js
最终 layout/_third-party/comments/gitalk.swig
配置如下:
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
{% if page.comments && theme.gitalk.enable %}
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script src="https://rawgit.com/qhh0205/78e9e0b1f3114db6737f3ed8cdd51d3a/raw/3894c5be5aa2378336b1f5ee0f296fa0b22d06e9/md5.min.js"></script>
<script type="text/javascript"></script>
{% endif %}