docs(v2): various improvements (#2768)

This commit is contained in:
Alexey Pyltsyn 2020-05-18 06:37:53 +03:00 committed by GitHub
parent cc688f48fc
commit fc161b8455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 180 additions and 159 deletions

View file

@ -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.