You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Inject decrypt-form.tpl to theme (experimental)
356
+
### Inject decrypt-form.tpl to theme
354
357
355
358
Some themes or plugins might interfere with the way this plugin encrypts the content of a page.
356
359
In this case this feature will find and encrypt a unique tag in the same way as `encrypted_something`
@@ -408,10 +411,31 @@ Some themes might override the default “search” plug-in provided by mkdocs,
408
411
> The modification of the search index is carried out last (if `encryptcontent` is also last in `plugins`).
409
412
> But always double-check the generated index after `mkdocs build` to see if your information is protected.
410
413
411
-
When the configuration mode is set to "**dynamically**", the [javascripts contribution files](https://github.com/CoinK0in/mkdocs-encryptcontent-plugin/tree/experimental/encryptcontent/contrib/templates/search)
414
+
When the configuration mode is set to "**dynamically**", the [javascripts contribution files](https://github.com/unverbuggt/mkdocs-encryptcontent-plugin/tree/master/encryptcontent/contrib/templates/search)
412
415
are used to override the default search plugin files provided by MKdocs. They include a process of decrypting and keeping the search index in a SessionStorage.
413
416
414
-
> **NOTE** The mode 'dynamically' is currently **not compatible with Material Theme** !
417
+
### Search index encryption for mkdocs-material
418
+
419
+
[Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) uses a different search plugin that cannot "easily" be overridden like the default search plugin.
420
+
However this Plugin will still remove encrypted pages (`encrypted`) or encrypt the search entries (`dynamically`) for `mkdocs-material`.
421
+
422
+
In order to be able to decrypt the search index (`dynamically`) `mkdocs-material` needs to be customized (patched).
423
+
424
+
You'll need some [prerequisites](https://squidfunk.github.io/mkdocs-material/customization/#environment-setup) and also execute these commands:
#copy material_search_worker.patch to mkdocs-material
434
+
patch -p 0 < material_search_worker.patch
435
+
436
+
pip install --force-reinstall .
437
+
#pip install --force-reinstall --no-deps . #faster if mkdocs-material was already installed
438
+
```
415
439
416
440
### Override default templates
417
441
@@ -472,8 +496,9 @@ You can set `reload_scripts:` in your `mkdocs.yml` with list of script source, t
472
496
473
497
```yaml
474
498
plugins:
475
-
reload_scripts:
476
-
- "./js/example.js"
499
+
- encryptcontent:
500
+
reload_scripts:
501
+
- "./js/example.js"
477
502
```
478
503
479
504
This feature use the following JQuery function to remove, add and reload javascripts.
@@ -485,6 +510,22 @@ var reload_js = function(src) {
485
510
};
486
511
```
487
512
513
+
### Self-host crypto-js
514
+
515
+
If you enable `selfhost` then you'll choose to upload crypto-js to your web server rather than using cloudflare CDN.
516
+
517
+
Additionally if you set `selfhost_download` then the required files will be downloaded **every time** on `mkdocs serve` or `mkdocs build`.
518
+
Be aware that this costs additional build time and it is better to copy the files from `site/assets/javascripts/cryptojs/*` to `docs/assets/javascripts/cryptojs/*` to speed things up.
519
+
520
+
```yaml
521
+
plugins:
522
+
- encryptcontent:
523
+
selfhost: true
524
+
selfhost_download: false
525
+
```
526
+
527
+
528
+
488
529
# Contributing
489
530
490
531
From reporting a bug to submitting a pull request: every contribution is appreciated and welcome.
0 commit comments