3

I'm using Docusaurus to make documentation.

I want to add an image to a markdown file, and also resize it to prevent it to be larger than needed.

Checking This answer, I realized this is possible using static html content in the md file, but since the image is statically in docs/assets, <img> tag can't find it.

![Github](assets/github_logo.jpg)

which can not be resized, and

<img src="assets/github_logo.jpg" width="200" />

which can't find the asset.

I will be happy to get any solutions.

Yangshun Tay
  • 41,572
  • 29
  • 112
  • 131
Mahdi-Malv
  • 12,361
  • 8
  • 52
  • 97

1 Answers1

4

This is not Docusaurus-specific. Markdown syntax doesn't allow you to resize images, you'd have to write raw HTML, which is fine too.

Your path has to be an absolute one and include a leading / in it. If your baseUrl is not / you'd have to include it in the path too.

Yangshun Tay
  • 41,572
  • 29
  • 112
  • 131