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

encryption is blocking the javascript library #70

Closed ghost closed 3 months ago

ghost commented 3 months ago

@unverbuggt

test.tar.gz

please see attached a test site i build and put the javascript functions with in the test site and it is listening to the document.getselect.

  1. The site is working fine and it is routing the javascript library through the extra_javascript but as soon as i enable the encryption using the https://github.com/unverbuggt/mkdocs-encryptcontent-plugin by adding this to the mkdocs.yml, it stops routing the javascript library and make no charts.
plugins:
  - search: {}
  - encryptcontent: {}
  1. You can test by running the unzip and then first by simply running the
    mkdocs build 
    mkdocs serve 

    and everything is working fine and then you can add the encryption by adding those aforementioned lines to the mkdocs.yml and then again

    mkdocs build
    mkdocs serve

    and the charts went off and it is no longer routing the javascript library.

let me know. Gaurav

kamilkrzyskow commented 3 months ago

Discussion started here:

unverbuggt commented 3 months ago

Hi,

in you test configuration, you set the extra_javascript like this:

extra_javascript:

extra_javascript:
  - <script src="https://cdn.plot.ly/plotly-2.33.0.min.js"></script>
  - <script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js">

Why? I don't believe this is the correct syntax. At least Firefox and Edge give me 404 errors this way. But the charts somehow work. None of your sites is encrypted, so the encryptcontent plugin should do nothing on the site (activating the plugin has no effect).

If you are using whatever javascript libraries on an encrypted page, then you might need to reload some scripts (explained here)