mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
docs(v2): various improvements (#2768)
This commit is contained in:
parent
cc688f48fc
commit
fc161b8455
20 changed files with 180 additions and 159 deletions
|
@ -36,17 +36,18 @@ import DocusaurusLogoWithKeytar from '@site/static/img/docusaurus_keytar.svg';
|
|||
|
||||
Thanks to MDX, you can also use `useBaseUrl` utility function in Markdown files! You'd have to use `<img>` tags instead of the Markdown image syntax though. The syntax is exactly the same as in JSX.
|
||||
|
||||
```txt title="my-doc.mdx"
|
||||
```jsx title="my-doc.mdx"
|
||||
---
|
||||
id: my-doc
|
||||
title: My Doc
|
||||
---
|
||||
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl'; // Add to the top of the file below the front matter.
|
||||
// Add to the top of the file below the front matter.
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
|
||||
...
|
||||
|
||||
<img alt="Docusaurus with Keytar" src={useBaseUrl('img/docusaurus_keytar.svg')} />;
|
||||
<img alt="Docusaurus with Keytar" src={useBaseUrl('img/docusaurus_keytar.svg')} />
|
||||
```
|
||||
|
||||
You could also just use Markdown image syntax, but you would have to manually maintain the image paths yourself and isn't recommended.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue