返回
Featured image of post 给博客加密的方法

给博客加密的方法

部署方案

  1. 把项目 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
    
  2. hugo_encryptor/shortcodes/hugo-encryptor.html 复制到 layouts/shortcodes/hugo-encryptor.html 这个位置去
  3. 在博客根目录下执行编译和加密
    1
    2
    
    hugo 
    hugo-encryptor.py
    
  4. 把加密后的public文件夹复制到 Nginx 文件夹里面
  5. 把解密所需的 decrypt.js 也复制到 Nginx 文件夹里面,这个文件是不变的
  6. 使用框框框起来所需要加密的内容块

正常图例

失败图例

Licensed under CC BY-NC-SA 4.0
© 2023 - 2025 壹壹贰捌· 0Days
共书写了258.5k字·共 93篇文章 京ICP备2023035941号-1