Build a Docusaurus site for production
build folder.npm run buildwebsite·Indexed 29 days ago
https://tusoul-docs.netlify.appDocumentation for Docusaurus, a static-site generator (Jamstack) used to build websites with Markdown and React. Includes tutorials on creating documents, React pages, blog posts, configuring i18n, and managing documentation versions for versions 1.0 and Next.
build folder.npm run buildLet's see how to [Create a page](/create-a-page).
Let's see how to [Create a page](./create-a-page.md).docs/intro.md) will be reflected automatically in the browser.cd my-website
npm run startTo release a specific version of your documentation, use the docs:version CLI command. This process copies the current docs folder into a new versioned directory (e.g., versioned_docs/version-1.0) and creates a versions.json file to track the versions.
After creating a version, Docusaurus maintains two sets of docs:
1.0) available at /docs/./docs/next/.npm run docusaurus docs:version 1.0Docusaurus allows editing of both released and unreleased documentation by modifying files in their respective directories:
versioned_docs/version-X.X/ (e.g., versioned_docs/version-1.0/hello.md updates the content at /docs/hello).docs/ folder (e.g., docs/hello.md updates the content at /docs/next/hello).export const Highlight = ({children, color}) => (
<span
style={{
backgroundColor: color,
borderRadius: '20px',
color: '#fff',
padding: '10px',
cursor: 'pointer',
}}
onClick={() => {
alert(`You clicked the color ${color} with label ${children}`)
}}>
{children}
</span>
);
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !build folder. By default, the site will be served at http://localhost:3000/.npm run serve<button onClick={() => alert('button clicked!')}>Click me!</button>Docusaurus allows independent editing of versioned and unreleased documentation.
versioned_docs/ (e.g., versioned_docs/version-1.0/hello.md).docs/ folder (e.g., docs/hello.md).Use the Docusaurus CLI to snapshot the current state of your docs folder into a versioned directory. This creates a static copy of the documentation for a specific release. After running the command, the docs folder is copied to versioned_docs/version-[versionNumber] and a versions.json file is generated.
Once versioned, the site will host two versions:
/docs/./docs/next/.npm run docusaurus docs:version 1.0:::) to create themed callout boxes such as tips and danger warnings.:::tip[My tip]
Use this awesome feature option
:::
:::danger[Take care]
This action is dangerous
:::