Image files do not display when using reference style links in Docusaurus

79 views Asked by At

We are considering a transition from mkdocs to docusaurus and are running into a small but annoying hurdle. In our mkdocs site we have adopted the convention of creating reference links at the bottom of each page. You can read more about this basic markdown functionality here (https://www.markdownguide.org/basic-syntax/#reference-style-links).

This approach allows us to easily review each page for outdated links and then just update the link in a single place. The reference links can include both URLs as well as paths to files used in the site that are stored in our GitHub Repo. URL reference links appear to work fine, but image reference links do not.

In mkdocs, with the first line of code I can display an image, which is defined in the second line of code. The first line appears somewhere in the doc and the second would be at the bottom.

![alt text][image description]

[image description]: /img/exampleimage.png

As I said, links like this work fine on our mkdocs site, but in docusaurus it just creates a broken image icon. Additionally, the file path doesn't seem to be the issue as the following code will render correctly in both mkdocs and docusaurus.

![alt text](/img/exampleimage.png)

I've tried other variations on the reference link file path (e.g. /static/img/exampleimage.png), but that did not work either.

Any suggestion for a solution or potential workaround are much appreciated. I have read through the docusaurus content about static file assets (https://docusaurus.io/docs/static-assets), but I have not determined whether the issue I am describing is expected or resolvable.

0

There are 0 answers