docs(v2): misc docs updates (#2500)

This commit is contained in:
Yangshun Tay 2020-04-02 12:29:39 +08:00 committed by GitHub
parent c47be44680
commit 8018a835e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 167 additions and 161 deletions

View file

@ -5,6 +5,8 @@ title: Creating Pages
In this section, we will learn about creating ad-hoc pages in Docusaurus using React. This is most useful for creating one-off standalone pages like a showcase page, playground page or support page.
The functionality of pages is powered by `@docusaurus/plugin-content-pages`.
## Adding a new page
<!-- TODO: What will the user see if pages/ is empty? -->
@ -75,6 +77,12 @@ my-website
.
```
:::caution
All JavaScript/TypeScript files within the `src/pages/` directory will have corresponding website paths generated for them. Do not put reusable components or test files (ending with `.test.js`) into that directory otherwise they will be turned into pages, which might not be intended.
:::
## Using React
React is used as the UI library to create pages. Every page component should export a React component and you can leverage on the expressiveness of React to build rich and interactive content.