跳到主要内容

简介

让我们在不到5分钟的时间内了解Docusaurus.

官方文档

快速入门

创建一个新的网站开始.

或者通过 docusaurus.new 立即体验Docusaurus!.

环境要求

  • Node.js 14.0及以上版本:
    • When installing Node.js, you are recommended to check all checkboxes related to dependencies.

生成一个新网站

使用 classic template 生成一个新网站.

The classic template will automatically be added to your project after you run the command:

npm init docusaurus@latest my-website classic

You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.

The command also installs all necessary dependencies you need to run Docusaurus.

启动

启动网站:

cd my-website
npm run start

The cd command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.

The npm run start command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.

Open docs/intro.md (this page) and edit some lines: the site reloads automatically and displays your changes.

下面是 Docusaurus教程 的概览: