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

docs: new light/dark mode toggle breaks logo in docs #208

Open
callumtilbury opened this issue Sep 15, 2023 · 0 comments
Open

docs: new light/dark mode toggle breaks logo in docs #208

callumtilbury opened this issue Sep 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@callumtilbury
Copy link
Contributor

callumtilbury commented Sep 15, 2023

Description

The change from #205, though successful when viewed on GitHub, breaks the Jumanji logo in MkDocs:

image

It seems that MkDocs is not correctly updating paths. Consider one of the other images on the page in README.md, e.g.:

<img src="docs/env_anim/bin_pack.gif" alt="BinPack" width="16%">

Notice that the image source is prefixed with the docs folder, src=docs/.... But when the docs are built, the resulting index.html:

<img src="env_anim/bin_pack.gif" alt="BinPack" width="16%">

That is, the docs/ prefix is correctly removed.

Yet with the dark/light logo, defined in README.md as:

<p align="center">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/img/jumanji_logo_dm.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/img/jumanji_logo.png">
  <img alt="Jumanji Logo" src="docs/img/jumanji_logo.png", width="50%">
</picture>
</p>

the resulting paths are not updated in index.html:

<p align="center">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="docs/img/jumanji_logo_dm.png">
  <source media="(prefers-color-scheme: light)" srcset="docs/img/jumanji_logo.png">
  <img alt="Jumanji Logo" src="docs/img/jumanji_logo.png", width="50%">
</picture>
</p>

hence the missing logo.

Additionally, note: even if we fix the src location issue, we may need to add custom CSS to handle prefers-color-scheme. MkDocs Material has gone for an approach where you append a hash fragment to the url, but GitHub has deprecated such an approach, in favour of what was done in #205.

(Issue found by @djbyrne.)

What Jumanji version are you using?

v0.3.1

Which accelerator(s) are you using?

n/a

Additional System Info

No response

Additional Context

No response

(Optional) Suggestion

No response

@callumtilbury callumtilbury added the bug Something isn't working label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant