Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jeetyadav98 opened this issue Feb 2, 2024 · 3 comments
Labels
help wanted Extra attention is needed wontfix This will not be worked on

Comments

@jeetyadav98
Copy link

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
Copy link
Owner

unverbuggt commented Feb 2, 2024

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
Copy link
Author

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 unverbuggt added wontfix This will not be worked on help wanted Extra attention is needed labels Feb 3, 2024
@unverbuggt
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants