Closed Duck5el closed 1 year ago
If I do this
<!-- ---
password: test
--- -->
# Test
bla
The docs build and I get these logs:
docs | INFO - Building documentation...
docs | INFO - "highlightjs" feature is disabled in your plugin configuration.
docs | INFO - "arithmatex" feature is disabled in your plugin configuration.
docs | INFO - "mermaid2" feature is disabled in your plugin configuration.
docs | INFO - Cleaning site directory
docs | INFO - Modified search_index.
docs | INFO - Downloading cryptojs for self-hosting (if needed)...
docs | INFO - Documentation built in 0.33 seconds
docs | INFO - [13:01:22] Watching paths for changes: 'docs', 'mkdocs.yml'
docs | INFO - [13:01:22] Serving on http://0.0.0.0:8000/
version: "3"
services:
docs:
container_name: docs
build: .
restart: always
volumes:
- ./volume:/docs
ports:
- 2022:8000
@unverbuggt search_entries
is type dict, containing the keys 'config' and 'docs'.
Line 629 should be search_entries['docs'].remove(entry)
to remove entry from docs list.
Thank you for the new version with many improvements.
You're welcome. This really fell under my radar (need to add a test for search_index: encrypted
mode). Thanks for the fix.
by removing the plugin search it is now working
plugins:
# - search
- encryptcontent
I guess the pip version is not updated jet.
/docs $ pip show mkdocs-encryptcontent-plugin
Name: mkdocs-encryptcontent-plugin
Version: 2.5.0
Summary: A MkDocs plugin that encrypt/decrypt markdown content with AES
Home-page: https://github.com/unverbuggt/mkdocs-encryptcontent-plugin
Author: unverbuggt
Author-email: unverbuggt@xn--rthlein-n2a.de
License: MIT
Location: /usr/local/lib/python3.11/site-packages
Requires: beautifulsoup4, mkdocs, pycryptodome, pyyaml
Now that I got it running I am facing another issue.
I can't submit my password when I press CTRL+ENTER nothing happens.
I also made sure the password I typed in Is correct.
Did you run pip install --upgrade mkdocs-encryptcontent-plugin
? the package on pip should be up-to-date.
Disabling the search
plugin also circumvents the problem with version 2.5.0.
were you able to input your password in the input field? For mkdocs-material
(also tested version 9.1.6) I use this configuration to set the classes:
plugins:
- encryptcontent:
input_class: 'md-search__form md-search__input'
button_class: 'md-search__icon'
it looks like the input field isn't visible in your screenshot. also try adding password_button: True
.
if you just press enter on an encrypted page it will save the password as "encryptcontentthat%2Fpages%2Furl%2Fescaped" in session storage. However, if you press ctrl+enter it will save as "encryptcontent". Normal pressing enter on you pages root (if it is encrypted) will also save as "encryptcontent". When you browse to another encrypted page the entries in the session storage are tried in order "encryptcontent", "encryptcontent_one%2Flevel%2Fup". If these tried passwords fail, you won't reveice an error message, only if you enter a wrong password yourself.
Best spot to debug this is to check javascript console output (F12 in most browsers) and also check the saved values to session storage (firefox: F12, Web-storage. Session storage, chrome/edge: F12, Application, Storage, Session Storage).
pip install --upgrade mkdocs-encryptcontent-plugin
fixed the problem with the search plugin.
But I am still facing the decrypt problem that the Button isn't working.
The console error says:
And by adding this to my yaml:
- search
- encryptcontent:
input_class: 'md-search__form md-search__input'
button_class: 'md-search__icon'
password_button: True
Everything looks normal now
ah, so cryptjs is missing.
this example in the documentation is probably not working as-is:
plugins:
- encryptcontent:
selfhost: true
selfhost_download: false
selfhost_dir: 'theme_overrides'
either disable selfhost: false
, this way crypro-js is downloaded from external cdn.
Or enable selfhost_download: true
and adjust selfhost_dir
to you custom dir of the theme. You can also remove selfhost_dir
and thus docs directory will be used to download.
If self hosting crypto-js is used, you shoudl have a "assets/javascripts/cryptojs" folder with js files in your site_dir.
wait... I think you found another bug...
please run pip install --upgrade mkdocs-encryptcontent-plugin
again. I just pushed a fixed version to pip.
Great It is working now!!
Thanks for your quick help.
When I start my mkdocs I am getting this erromessage
This is my Dockerfile