fix: 退回之前的inject實現,解決上一個版本導致無法插入inject的bugs close #390

This commit is contained in:
Jerry
2020-10-15 14:39:51 +08:00
parent 8014ddb65e
commit 666637ce99
5 changed files with 14 additions and 24 deletions

View File

@@ -61,3 +61,12 @@ hexo.extend.helper.register('urlNoIndex', function () {
hexo.extend.helper.register('md5', function (path) {
return crypto.createHash('md5').update(decodeURI(this.url_for(path))).digest('hex')
})
hexo.extend.helper.register('injectHtml', function (data) {
let result = ''
if (!data) return ''
for (let i = 0; i < data.length; i++) {
result += data[i]
}
return result
})