部署方案
- 把项目 git clone 到博客里面
1 2 3 4
git clone https://github.com/Li4n0/hugo_encryptor.git cd hugo_encryptor chmod +x hugo-encryptor.py pip3 install -r requirements.txt
- 把
hugo_encryptor/shortcodes/hugo-encryptor.html
复制到layouts/shortcodes/hugo-encryptor.html
这个位置去 - 在博客根目录下执行编译和加密
1 2
hugo hugo-encryptor.py
- 把加密后的
public
文件夹复制到 Nginx 文件夹里面 - 把解密所需的
decrypt.js
也复制到 Nginx 文件夹里面,这个文件是不变的 - 使用框框框起来所需要加密的内容块

正常图例

失败图例
