Skip to content

additional-css and additional-js generate broken paths #1883

New issue

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

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

Already on GitHub? # to your account

Open
GuillaumeGomez opened this issue Aug 30, 2022 · 0 comments
Open

additional-css and additional-js generate broken paths #1883

GuillaumeGomez opened this issue Aug 30, 2022 · 0 comments
Labels
A-HTML Area: HTML Rendering

Comments

@GuillaumeGomez
Copy link
Member

For example, I used:

[output.html]
additional-css = ["../../../../src/tools/error_index_generator/extra.css"]
additional-js = ["../../../../src/tools/error_index_generator/extra-info.js"]

The path is relative to the source directory so the files are copied as they should, however it generates in the output HTML:

<link rel="stylesheet" href="../../../../../src/tools/error_index_generator/extra.css">
<!-- and below -->
<script type="text/javascript" src="../../../../../src/tools/error_index_generator/extra-info.js"></script>

Which is of course completely wrong and non-sensical. The path should be set based on the top-level of the mdbook build directory and use much shorter paths as it won't work if I distribute this generated content. The correct path should be "../extra-info.js" (and equivalent for the CSS).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-HTML Area: HTML Rendering
Projects
None yet
Development

No branches or pull requests

2 participants