fix(gitalk): 修复 MD5 函数导致的评论聚合问题

- 修改 url_for 调用添加 {relative: false} 参数
- 解决空字符串 MD5 导致多页面评论混合的问题
This commit is contained in:
Windsland52
2025-07-30 08:27:46 +08:00
committed by GitHub
parent 0e9b8f5b69
commit 0da72787fa

View File

@@ -48,7 +48,7 @@ hexo.extend.helper.register('urlNoIndex', function (url = null, trailingIndex =
})
hexo.extend.helper.register('md5', function (path) {
return crypto.createHash('md5').update(decodeURI(this.url_for(path))).digest('hex')
return crypto.createHash('md5').update(decodeURI(this.url_for(path, {relative: false}))).digest('hex')
})
hexo.extend.helper.register('injectHtml', data => {