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

Incorrect CSS/JS link href in projects with root site_url #6877

Closed
4 tasks done
Blacksmoke16 opened this issue Mar 6, 2024 · 3 comments
Closed
4 tasks done

Incorrect CSS/JS link href in projects with root site_url #6877

Blacksmoke16 opened this issue Mar 6, 2024 · 3 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@Blacksmoke16
Copy link

Blacksmoke16 commented Mar 6, 2024

Context

Previously discussed in #5800 (reply in thread).

Seemingly is a regression of #6437.

Bug description

When the root project of a projects plugin sets a site_url to root, e.g. http://example.com/ versus http://example.com/docs, and when the child projects setting something else, e.g. http://example.com/MyApp, then the href attribute of the generated link tags for the CSS/JS of the sub-project are incorrect. This causes them to 404 and not properly

Related links

Reproduction

bug.zip

Steps to reproduce

  1. python3 -m venv venv
  2. . venv/bin/activate
  3. pip install --upgrade --force-reinstall mkdocs-material
  4. Run mkdocs serve
  5. Try to navigate to the /MyApp page

Browser

Chrome

Before submitting

@squidfunk squidfunk added the bug Issue reports a bug label Mar 6, 2024
@squidfunk
Copy link
Owner

Thanks for reporting! Temporary mitigation:

plugins:
  - projects:
      hoisting: false

@squidfunk
Copy link
Owner

Fixed in 7c4ef0b. There was a bug in path computation if paths where computed from site_url, sometimes returning an absolute path, which explains that the file system path was part of the asset URL. There are many different configurations that we need to account for (no site_url set, some set, all set, site_url pointing to same base paths, etc.). Additionally, the fix in #6437 was not specific enough and was also adapted, so the reproduction in #6437 remains working.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Mar 6, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.13+insiders-4.53.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants