Skip to content

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

Open
@GuillaumeGomez

Description

@GuillaumeGomez

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-HTMLArea: HTML Rendering

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions