Docusaurus: [Docs] Document how static assets (such as images) should be handled

Created on 22 Nov 2017  路  6Comments  路  Source: facebook/docusaurus

See https://github.com/facebookexperimental/Docusaurus/blob/master/lib/server/generate.js#L183

It looks like we automatically handle converting 'assets/' references to 'docs/assets'.

Does that mean I should create an 'assets' folder in my docs folder for all my images? Will Docusaurus copy images from that assets folder to the right place?

documentation good first issue

Most helpful comment

Yes. The example as bellow should be change to ![alt-text](assets/doc-image.png).
And it seems have been changed already. See here.

image

All 6 comments

Yep, it looks like we handle this automatically <3

Images placed into docs/assets are copied to the right place. References to assets/myImage.png will correctly load the image when the site is rendered.

Let's document it?

Yes. The example as bellow should be change to ![alt-text](assets/doc-image.png).
And it seems have been changed already. See here.

image

I believe this issue can be closed.

@longility Did we document this? Sometimes I forget 馃槃

@JoelMarcey I by no means have tested what this documentation says. I'm just helping close some issues so I may not be too familiar with this.

After a little more investigation, the generated doc from gh-pages does not reflect the markdown source. Not sure why as I would expect it to have already been deployed as it has been more than seven months.

@longility: Changes to docs/ are reflected in the next "master" version.

I am closing this issue. It is documented at
https://docusaurus.io/docs/en/doc-markdown.html#linking-to-images-and-other-assets

Was this page helpful?
0 / 5 - 0 ratings

Related issues

endiliey picture endiliey  路  3Comments

endiliey picture endiliey  路  3Comments

chandankumar4 picture chandankumar4  路  3Comments

JoelMarcey picture JoelMarcey  路  3Comments

cheercroaker picture cheercroaker  路  3Comments