Extend Docusaurus layouts using React
Docusaurus is powered by React, allowing developers to extend or customize the website layout. You can create custom components or pages while maintaining the existing global header and footer.
website·Indexed 29 days ago
https://statuesque-centaur-3dbfb8.netlify.app/A static-site generator (Jamstack) designed for quickly setting up websites. It features built-in support for Markdown and React pages, documentation versioning, i18n translation, and a blogging system with tags and RSS feeds.
```jsx title="src/components/HelloDocusaurus.js"
function HelloDocusaurus() {
return <h1>Hello, Docusaurus!</h1>;
}To create a standalone page, add a Markdown (.md) or React (.js) file to the src/pages directory. The file system path determines the URL route. For example:
src/pages/index.js maps to /src/pages/foo.md maps to /foosrc/pages/foo/bar.js maps to /foo/bar<button onClick={() => alert('button clicked!')}>Click me!</button>npm init command. This process automatically adds the template to your project and installs all necessary dependencies.npm init docusaurus@latest my-website classicbuild folder locally. Running the serve command will host the static files at http://localhost:3000/.npm run serve:::type[Title] syntax.:::tip[My tip]
Use this awesome feature option
:::
:::danger[Take care]
This action is dangerous
:::<!-- truncate --> HTML comment within the post content. Content appearing after this comment will be hidden in the list view and only visible on the full post page.This text will appear in the blog list view.
<!-- truncate -->
This text will only appear on the full blog post page.docs/ directory. For example, creating docs/hello.md will make the document available at /docs/hello.# Hello
This is my **first Docusaurus document**!static directory or relative paths to colocate images with Markdown files.
docs/intro.md) will be displayed automatically.cd my-website
npm run startDocusaurus allows you to snapshot your current documentation into a specific version. Running the versioning command copies the contents of the docs folder into a new directory under versioned_docs/ and updates the versions.json file.
After creating a version (e.g., '1.0'), the site will host two sets of docs:
1.0) at /docs/./docs/next/.npm run docusaurus docs:version 1.0