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

Support collocated images #3061

Closed
tvvignesh opened this issue Jul 15, 2020 · 5 comments · Fixed by #3069
Closed

Support collocated images #3061

tvvignesh opened this issue Jul 15, 2020 · 5 comments · Fixed by #3069
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@tvvignesh
Copy link

Hi. I am using docusaurus v2. While everything works great, trailing slash is breaking images.

I have a markdown syntax like this where I am storing myimage in the same folder as the markdown file

[![IMAGE ALT TEXT](./myimage.png)](https://www.example.com "My Image description")

It fails because of the trailing slash. If I fix in the website by maybe adding ../ it will not render in Github. Is there any way to make it work both in Github and the website as well?

Screenshot below:

Screenshot from 2020-07-15 09-34-55

Directory structure:

Screenshot from 2020-07-15 09-37-43

I guess the same path logic you guys are using for generating html out of .md and rewriting paths can be used for images as well.

Thanks in advance.

@tvvignesh tvvignesh added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jul 15, 2020
@tvvignesh
Copy link
Author

If I put it in static folder and try to access it that way, it will work in the website but will break when rendering in the Github repo. Was wondering what to do.

@slorber
Copy link
Collaborator

slorber commented Jul 15, 2020

Hi,

Currently we don't support well using relative md images, so it's hard to support both github + website at the same time.

This is something I want to solve in #3057

@tvvignesh
Copy link
Author

@slorber Thanks for the clarification. Will use the absolute url till then. Feel free to close this issue if you want.

@anshulrgoyal
Copy link
Contributor

#3069 this solve relative images

@slorber
Copy link
Collaborator

slorber commented Jul 24, 2020

Hey all, this is feature is now released!
If you like it, don't forget to retweet 😄
https://twitter.com/docusaurus/status/1286715187983048704

@Josh-Cena Josh-Cena added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 8, 2022
@Josh-Cena Josh-Cena changed the title Trailing slash breaks images Support collocated images Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
4 participants