unverbuggt / mkdocs-encryptcontent-plugin

A MkDocs plugin that encrypt/decrypt markdown content with AES
https://unverbuggt.github.io/mkdocs-encryptcontent-plugin/
MIT License
123 stars 15 forks source link

level: and !ENV not working, but local password: on a page is #51

Closed guise closed 1 year ago

guise commented 1 year ago

Hi — as per title

I've stripped my project back to barebones trying to debug and figure out where I'm going wrong, but i've hit a brick wall.

mkdocs.yml config:

site_name: Test
use_directory_urls: true
nav:
  - Test: test.md
plugins:    
  - search: {}
  - encryptcontent:
      password_inventory:
        secret1: 'test'
        secret2: !ENV TESTVAR
      password_button: true

test.md

---
level: secret1
---

# test heading

test page

Things are working fine using password: test as a meta tag in the test page, or setting a global_password: 'test' in mkdocs.yml

However, setting level: secret1 or level: secret2 in test.md meta tags does nothing

!ENV TESTVAR also works fine when using it to set the page title.

I feel like i'm going mad missing something obvious!?

I'm running:

unverbuggt commented 1 year ago

Hi,

I've set the "version3" branch als main branch lately, because I want to release v3.x soon, which will bring features like password_inventory. But pip is still on 2.x, so If you want the documentation for the latest 2.x release, please check here.
However, there are pre-releases available to give a try, but I already found a sack full of bugs yesterday, so the latest pre-release is not on par, yet. So best do this:

pip install wheel #not sure if other packages are needed

git clone https://github.com/unverbuggt/mkdocs-encryptcontent-plugin.git
cd mkdocs-encryptcontent-plugin/
python setup.py sdist bdist_wheel
pip install --force-reinstall --no-deps dist/mkdocs_encryptcontent_plugin-3.0.0.dev3-py3-none-any.whl
guise commented 1 year ago

That worked perfectly, thank you!

Would it be advised to switch back to a pip install once v3 is released? If so, what would be the best way to do so?

unverbuggt commented 1 year ago

All you need to do is pip install --upgrade mkdocs-encryptcontent-plugin once v3 is released.