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

[Doc] How to properly embed an SVG image into markdown doc #52

Closed
3 tasks done
frank-zsy opened this issue Oct 2, 2024 · 4 comments
Closed
3 tasks done

[Doc] How to properly embed an SVG image into markdown doc #52

frank-zsy opened this issue Oct 2, 2024 · 4 comments

Comments

@frank-zsy
Copy link
Contributor

Are you certain it's a bug?

  • Yes, it looks like a bug

Are you sure this is not an issue in Docusaurus?

  • It is not a Docusaurus issue

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

In the doc file https://open-digger.cn/docs/user_docs/metrics/global_openrank right now I use absolute URL for the embedded SVG image because a relative URL will fail to load and show a 404 page in the embed position.

But in the former version, I use /img/global_openrank.svg as src and all looks good in npm start and npm run build && npm run serve. But only after deployed, the image fails to load.

Besides the bug in production mode, it is also wrong in preview mode, because if I use /img/global_openrank.svg, I need to inject the base URL like /pull_51/img/global_openrank.svg to make it work.

I do not know how to make this work for all circumstances since it seems that @site does not work here.

Does anyone can help with this?

@frank-zsy
Copy link
Contributor Author

@Neilblaze could you please give a look on this one and see if you know what happened here

@Neilblaze
Copy link
Member

@frank-zsy sorry for the delay, I'm travelling right now and will be back by the 4th instant. I'll give it a closer look once I'm back, and hopefully come up with a solution. Thanks!

Neilblaze added a commit to Neilblaze/open-digger that referenced this issue Oct 6, 2024
Signed-off-by: neilblaze <[email protected]>
@Neilblaze
Copy link
Member

This seemed like a Docusaurus glitch, but now it's fixed! Please take a reply, and reopen this issue if required.
cc: @frank-zsy

@frank-zsy
Copy link
Contributor Author

Looks great, thanks for the help~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants