yiyungent/hexo-anti-spider

hexo-generator-json-content 失效

Opened this issue · 1 comments

加密后, 无 posts, 分类 ,tags 内容

https://github.com/alexbruno/hexo-generator-json-content/blob/64416b3e56c8d06439fa679b438ed8ec437edf1f/src/modules/utils.js#L43

解决:

GitHub Action 中加入

# fixed: 使用 hexo-blog-encrypt 加密后, 导致 hexo-generator-json-content 失效
# obj.text = minify(ref.content) -> obj.text = minify(ref.origin)
cat './node_modules/hexo-generator-json-content/dist/main.js' | sed 's/obj.text = minify(ref.content)/obj.text = minify(ref.origin)/g' | tee './node_modules/hexo-generator-json-content/dist/main.js'
cat './node_modules/hexo-generator-json-content/dist/module.js' | sed 's/obj.text = minify(ref.content)/obj.text = minify(ref.origin)/g' | tee './node_modules/hexo-generator-json-content/dist/module.js'
# if (content.password || content.hidden) -> if (content.hidden)
cat './node_modules/hexo-generator-json-content/dist/main.js' | sed 's/if (content.password || content.hidden)/if (content.hidden)/g' | tee './node_modules/hexo-generator-json-content/dist/main.js'
cat './node_modules/hexo-generator-json-content/dist/module.js' | sed 's/if (content.password || content.hidden)/if (content.hidden)/g' | tee './node_modules/hexo-generator-json-content/dist/module.js'

失败