tutorial use .mdx

This commit is contained in:
sebastienlorber 2023-01-05 18:05:17 +01:00
parent bc680e280a
commit 616440622f
2 changed files with 18 additions and 9 deletions

View file

@ -8,9 +8,9 @@ Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/sy
:::info
Docusaurus is based on **[MDX](https://mdxjs.com/)**. It allows you to use **[React and JSX](https://reactjs.org/docs/introducing-jsx.html)** in your Markdown documents.
Docusaurus is based on **[MDX](https://mdxjs.com/)**. It allows you to use **[React and JSX](https://reactjs.org/docs/introducing-jsx.html)** in Markdown documents.
You can use both `.md` and `.mdx` file extensions. We **recommend using the `.mdx` extension by default** and whenever using any advanced feature not included in [CommonMark](https://commonmark.org/): admonitions, tabs, React, JSX...
You can use both `.md` and `.mdx` file extensions, but **the `.mdx` extension** is recommended when using advanced features relying on React.
:::

View file

@ -98,14 +98,15 @@ Assuming you chose the classic template and named your site `my-website`, you wi
```bash
my-website
├── blog
│ ├── 2019-05-28-hola.md
│ ├── 2019-05-29-hello-world.md
│ └── 2020-05-30-welcome.md
│ ├── 2019-05-28-hola.mdx
│ ├── 2019-05-29-hello-world.mdx
│ └── 2020-05-30-welcome.mdx
├── docs
│ ├── doc1.md
│ ├── doc2.md
│ ├── doc3.md
│ └── mdx.md
│ ├── intro.mdx
│ ├── pages.mdx
│ ├── blog.mdx
│ ├── docs.mdx
│ └── markdown-features.mdx
├── src
│ ├── css
│ │ └── custom.css
@ -121,6 +122,14 @@ my-website
└── yarn.lock
```
:::info
Docusaurus is based on **[MDX](https://mdxjs.com/)**. It allows you to use **[React and JSX](https://reactjs.org/docs/introducing-jsx.html)** in Markdown documents.
You can use both `.md` and `.mdx` file extensions, but **the `.mdx` extension** is recommended when using advanced features relying on React.
:::
### Project structure rundown {#project-structure-rundown}
- `/blog/` - Contains the blog Markdown files. You can delete the directory if you've disabled the blog plugin, or you can change its name after setting the `path` option. More details can be found in the [blog guide](blog.mdx)