mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 08:49:51 +02:00
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:
parent
3e22c1ae5c
commit
6730590c1e
10 changed files with 120 additions and 64 deletions
|
@ -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
|
||||
|
||||

|
||||
```
|
||||
|
@ -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}}
|
||||
/>
|
||||

|
||||
|
||||
:::note
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue