Không có mô tả

Li4n0 d3aa365cb1 feat(shortcodes/hugo-encryptor.html): Support user to choose the way of storaging post password in c 6 năm trước cách đây
example_site 5744e5f494 python & shortcodes 6 năm trước cách đây
shortcodes d3aa365cb1 feat(shortcodes/hugo-encryptor.html): Support user to choose the way of storaging post password in c 6 năm trước cách đây
.gitignore 4f7f207d22 feat: Implement the front end 6 năm trước cách đây
CHANGELOG.md 7cbd29ae7f build(CHANGELOG.md): Init development environment 6 năm trước cách đây
README.md 02fd15b86a update README.md 6 năm trước cách đây
commitlint.config.js 61018ad50f build: 6 năm trước cách đây
hugo-encryptor.py 4f7f207d22 feat: Implement the front end 6 năm trước cách đây
package-lock.json 61018ad50f build: 6 năm trước cách đây
package.json 61018ad50f build: 6 năm trước cách đây

README.md

Hugo Encryptor

Hugo-Encryptor is a tool to protect your Hugo posts. It uses AES-128 to encrypt the contents of your posts, and inserts a snippet of <script> code to verify whether the password is correct or not in readers' browser. Without a correct key, nobody can decrypt your private posts.

Installation

Step 1: Install all the requirements of Hugo-Encryptor.

$ cd Hugo-Encryptor
$ pip install -r requirements.txt

Step 2: Place hugo-encryptor.py somewhere in the directory of your blog.

$ cp hugo-encryptor.py /path/to/your/blog/hugo-encryptor.py

Step 3: Install our Hugo shortcodes file into your blog:

$ mkdir -p /path/to/your/blog/layouts/shortcodes
$ cp shortcodes/hugo-encryptor.html /path/to/your/blog/layouts/shortcodes/hugo-encryptor.html

Usage

A typical way to use Hugo-Encryptor has been already uploaded in example_site.

Step 1: Call our hugo-encryptor shortcodes if you want to encrypt a very post

---
title: This Is An Encrypted Post
---

{{% hugo-encryptor "PASSWORD" %}}

# You cannot see me unless you've got the password!

This is the content of my private post!

**Do remember to close the `hugo-encryptor` shortcodes tag:**

{{% /hugo-encryptor %}}

Step 2: Generate your site as usual

It may be something like:

$ hugo

Step 3: Get the encryption done!

$ python hugo-encryptor.py --path /path/to/your/blog/public

Then all the private posts in your public directory would be encrypted thoroughly, congrats!

Attentions

  • Do remember to keep the source code of your encrypted posts private. A typical way to deal with them is to ignore them by adding content/posts/ in your .gitignore file.