^-^
Web开发者|阅读写作爱好者
hexo | A4支持文章密码访问
  1. 效果演示
  2. 使用方法

效果演示

以下页面已加密,密码为:123456

点击访问

使用方法

你的网站文件夹,举例为website

  1. 命令行进入到webiste目录。

  2. 执行命令安装hexo插件:

npm install hexo-blog-encrypt
  1. 添加如下配置到_config.yml文件(注意不是A4主题的配置文件)
# hexo 支持 加密访问文章 插件
encrypt:
  enable: true
  abstract: Here's something encrypted, password is required to continue reading.
  message: Hey, password is required here.
  wrong_pass_message: Oh, this is an invalid password. Check and try again, please.
  wrong_hash_message: Oh, these decrypted content cannot be verified, but you can still have a look.
  1. 在想要文章支持加密的post的front-matter中添加
password: 123456
  1. 执行命令查看效果
hexo clean && hexo g && hexo s

引用:

以上