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

How do I encrypt an HTML page not generated by mkdocs, but is attached to the website? #63

Closed jeetyadav98 closed 6 months ago

jeetyadav98 commented 7 months ago

Hi, I am using https://github.com/timvink/mkdocs-print-site-plugin this plugin to allow for printing of the website. The HTML file which it generates for printing is available at siteAddress/print_page.html - however, the encrypt plugin doesn't extend to this page, and it is visible to everyone.

I tried using encrypted_something: {} to refer to print_page but it didn't work, and I don't know where the file is generated and hence cant enter the tags.

Quite confused here and would love some help!

unverbuggt commented 7 months ago

Hi, I am currently unaware how this plugin works. I'll check.

Maybe there is an easy way to also encrypt these printable pages, but it could be rather complicated or impossible. Would it be enough to just remove these pages on build (if the normal page is encrypted)?

Edit: Did you make sure to put encryptcontent at the end of the plugin list like this?

plugins:
  - search
  - print-site
  - encryptcontent

It is already possible to exclude singe or multiple pages from the plugin: https://timvink.github.io/mkdocs-print-site-plugin/how-to/do_not_print.html#ignoring-an-entire-page

jeetyadav98 commented 7 months ago

Hi, changing the order didn't work here. The print page is still exposed.

My aim here is to offer a print page only to those who have the password to the site itself.

unverbuggt commented 7 months ago

Hi, then I suggest you should exclude (do not print) the encrypted pages from the build for now.

These pages are generated by the print-site-plugin and not in the normal document tree (at least not on first sight). So one possibility would be to find a way to access these files duing build and inject the encrypted version somehow. But this is not high priority for me (any help appreciated). Also it won't be possible to encrypted the generated PDFs