https://github.com/six-two/mkdocs-encrypt-source-plugin
Keep certain information encrypted in your page’s source code and decrypt them during the page’s build
https://github.com/six-two/mkdocs-encrypt-source-plugin
Last synced: 4 months ago
JSON representation
Keep certain information encrypted in your page’s source code and decrypt them during the page’s build
- Host: GitHub
- URL: https://github.com/six-two/mkdocs-encrypt-source-plugin
- Owner: six-two
- License: mit
- Created: 2024-08-18T07:00:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-18T14:53:32.000Z (almost 2 years ago)
- Last Synced: 2026-01-04T00:16:24.943Z (5 months ago)
- Language: Python
- Homepage: https://mkdocs-encrypt-source-plugin.vercel.app
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MkDocs Placeholder Plugin
[](https://pypi.org/project/mkdocs-encrypt-source-plugin/)


This plugin allows you to store sensitive information in encrypted form it the source code.
When you build the site, it is decrypted using a key you pass as an enviroment variable.
This means only people with the key or access to the deployed website can access the information.
It also prevents code scanning tools from checking the data you store encrypted.
## Installation and usage
Installation and usage is described in more detail in [docs/usage.md](https://mkdocs-encrypt-source-plugin.six-two.dev/usage/).
The quick summary is:
1. Install it with pip:
```bash
mkdocs-encrypt-source-plugin
```
2. Add `encrypt-source` to the `plugins` list in `mkdocs.yml`.
3. Generate an encryption/decryption key:
```bash
echo -n | mkdocs-encrypt-source-cli -e -k "" >/dev/null
```
And export the generated key as environment variable:
```bash
export MKDOCS_ENCRYPT_SOURCE_KEY='WCFY7FJ2TlpXIG0nEqpSltXTAYB9gO3Ob6tS-psY9-s='
```
4. Encrypt all values you want to encrypt with:
```bash
echo -n "Value to encrypt" | mkdocs-encrypt-source-cli -e
```
and put the output in your Markdown source files.
5. Build the page with `mkdocs serve` and check that all encrypted values are correctly decrypted.