bigwolftime / gitmentCommentsPlugin

0 stars 0 forks source link

Welcome to Jekyll! #4

Open bigwolftime opened 5 years ago

bigwolftime commented 5 years ago

https://bwt.gitlab.io/blog/jekyll/update/2016/03/24/welcome-to-jekyll.html

bigwolftime commented 5 years ago

...

bigwolftime commented 5 years ago

使用 gitment 作为评论插件,当 script 标签中的 id 字段过长就会导致评论的初始化失败,弹出类似“Validation failed”错误,一般的解决办法是用文章的标题,或者发布时间作为 id 的值。 我使用的办法是对当前 URI 的截取:

    id: decodeURI(window.location.pathname).substring(window.location.pathname.length - 49,window.location.pathname.length),