refactor(v2): async md image transformer + pathname protocol as an escape hatch (#3087)

* async md image transformer + pathname protocol as an escape hatch

* make error messages computer agnostic by using relative paths

* fix error message relative path
This commit is contained in:
Sébastien Lorber 2020-07-21 17:45:06 +02:00 committed by GitHub
parent 3e22c1ae5c
commit 6730590c1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 120 additions and 64 deletions

View file

@ -951,7 +951,7 @@ Let's imagine the following file structure:
/website/docs/assets/docusaurus-asset-example.xyz
```
### Image assets:
### Image assets
You can use images by requiring them and using an image tag through MDX:
@ -960,7 +960,7 @@ You can use images by requiring them and using an image tag through MDX:
<img src={require('./assets/docusaurus-asset-example-banner.png').default} />
or
or
![](./assets/docusaurus-asset-example-banner.png)
```
@ -976,12 +976,7 @@ import myImageUrl from './assets/docusaurus-asset-example-banner.png';
This results in displaying the image:
<img
src={
require('!file-loader!./assets/docusaurus-asset-example-banner.png').default
}
style={{maxWidth: 300}}
/>
![](./assets/docusaurus-asset-example-banner.png)
:::note