mkdocs-open-in-new-tab icon indicating copy to clipboard operation
mkdocs-open-in-new-tab copied to clipboard

`js/open-in-new-tab.js` not loaded when on GH Pages with a subfolder

Open ebouchut opened this issue 1 year ago • 0 comments

Description of the Issue

The plugin injects js/open-in-new-tab.js to the extra-javascript: section here

✅ This works fine locally: when using mkdocs serve where I can see the up-right arrow:

http://127.0.0.1:8000/

❌ However, this does not work, i.e. I cannot see the up-right arrow:
when deployed to my own GitHub Pages with mkdocs gh-deploy --force

https://ericbouchut.com/trio-docs/

Cause

The /js/open-in-new-tab.js file cannot be loaded (Error 404) because it is in /trio-docs/js/open-in-new-tab.js.

The items in extra_javascript have changed since Mkdocs version 1.5. This could be a clue.

Fix?

I tried to fix things in the plugin code (PR is underway). The fix now works fine in both cases.

I need your guidance and a double pair of eyes.

ebouchut avatar Oct 28 '24 20:10 ebouchut