Creating pages
Pages are distinct from other types of content in that they are intended as one-off, standalone content, such as a showcase, playground or support page. They can contain React components and Markdown. Note that pages don't have sidebars.
Refer to the Pages Plugin API Reference in the Docusaurus documentation for an exhaustive list of options.
Add a page
- From the Pages collection in the CMS, click Add File.
- Give it a Title and a Description.
- Add your content in the rich text editor.
- Click Save.
Add React components to a page
DocStatic's React components are available globally. But if you're only using a component on one page it doesn't make sense to do this. Instead, you can import the component directly into the page. However, to ensure you can edit the page in the CMS, you need to wrap the import directive in a Passthrough component. The example page on the DocStatic site imports the ColorGenerator component like this:
<Passthrough type="jsx" string="import ColorGenerator from '@site/src/components/ColorGenerator';" summary="Import Statement" />
<Passthrough type="jsx" string="<ColorGenerator />" summary="JSX Component" />
For more information, refer to Creating Pages in the Docusaurus documentation.