Github链接:https://github.com/MikeCoder/hexo-blog-encrypt/blob/master/ReadMe.md
将 "hexo-blog-encrypt": "2.0.*" 添加到Hexo根目录的package.json文件中。
[root@localhost hexo]# cat package.json
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.5.0"
},
"dependencies": {
"hexo": "^3.2.0",
"hexo-baidu-url-submit": "0.0.5",
"hexo-generator-archive": "^0.1.4",
"hexo-generator-baidu-sitemap": "^0.1.2",
"hexo-generator-category": "^0.1.3",
"hexo-generator-feed": "^1.2.2",
"hexo-generator-index": "^0.2.0",
"hexo-generator-sitemap": "^1.2.0",
"hexo-generator-tag": "^0.2.0",
"hexo-helper-qrcode": "^1.0.2",
"hexo-renderer-ejs": "^0.2.0",
"hexo-renderer-jade": "^0.3.0",
"hexo-renderer-marked": "^0.2.11",
"hexo-renderer-sass": "^0.3.2",
"hexo-renderer-stylus": "^0.3.3",
"hexo-search-data-plugin": "^1.1.0",
"hexo-server": "^0.2.0",
"hexo-blog-encrypt": "2.0.*"
}
}
安装
[root@localhost hexo]# npm install
更新
[root@localhost hexo]# npm update
更改config,追加如下内容
[root@localhost hexo]# tail -n 3 _config.yml
#Security
encrypt:
enable: true
增加一个文章测试
[root@localhost hexo]# head -n 12 source/_posts/girl.md
---
title: girl
tags:
- 随笔
id: 29912
categories:
- 随笔
date: 2017-12-05 11:28:44
password: test
abstract: Welcome to my blog, enter password to read.
message: Welcome to my blog, enter password to read.
---
生成静态页面
hexo g d