You can run the doc site locally to see edits to the documents in real time. To get started:
- Make sure all the dependencies for the website are installed:
# Install dependencies
$ npm i
- Run the dev server:
# Start the site
$ npm start
The docs should open in a new page in your browser. While the server is running, you can find the site at http://localhost:3000
Edit docs by navigating to docs/
and editing the corresponding document:
docs/doc-to-be-edited.md
---
id: page-needs-edit
title: This Doc Needs To Be Edited
---
Edit me...
For more information about docs, click here
- Add links to docs, custom pages or external links by editing the headerLinks field of
website/siteConfig.js
:
website/siteConfig.js
{
headerLinks: [
...
/* you can add docs */
{ doc: 'my-examples', label: 'Examples' },
/* you can add custom pages */
{ page: 'help', label: 'Help' },
/* you can add external links */
{ href: 'https://github.com/facebook/Docusaurus', label: 'GitHub' },
...
],
...
}
For more information about the navigation bar, click here
- Docusaurus uses React components to build pages. The components are saved as .js files in
website/pages/en
: - If you want your page to show up in your navigation header, you will need to update
website/siteConfig.js
to add to theheaderLinks
element:
website/siteConfig.js
{
headerLinks: [
...
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
...
],
...
}
For more information about custom pages, click here.
Full documentation can be found on the Docusaurus website.