hexo给博客添加密码
Easul Lv6
1
2
# 在hexo根目录下安装插件
npm install --save hexo-blog-encrypt

__config.xml内配置密码相关的信息

1
2
3
4
5
6
7
8
9
10
11
12
# hexo-blog-encrypt
encrypt:
abstract: 这里有东西被加密了,需要输入密码查看哦。
message: 您好, 这里需要密码.
tags:
- {name: tagName, password: 密码A}
- {name: tagName, password: 密码B}
# default, blink, flip, shrink, surge, up, wave, xray
# check out the theme at https://mhexo.github.io/tags/ThemeTests/
theme: xray
wrong_pass_message: 抱歉, 这个密码看着不太对, 请再试试.
wrong_hash_message: 抱歉, 这个文章不能被校验, 不过您还是能看看解密后的内容.

如果输入密码后无反应,控制台报错Cannot read properties of undefined (reading 'importKey')
那是因为网站不是https的缘故,加上https证书即可

hexo 插件hexo-blog-encrypt 实现对文章的加密
输入密码之后没反应 console报错如下

 评论