此文档将教授您如何将现有的 Docusaurus 1 网站更新至 Docusaurus 2。
我们尽力精简这一流程，且提供了迁移 CLI 工具。
Your Docusaurus 1 site should have the following structure:
├── docs└── website ├── blog ├── core │ └── Footer.js ├── package.json ├── pages ├── sidebars.json ├── siteConfig.js └── static
After the migration, your Docusaurus 2 site could look like:
├── docs└── website ├── blog ├── src │ ├── components │ ├── css │ └── pages ├── static ├── package.json ├── sidebars.json ├── docusaurus.config.js
This migration does not change the
/docs folder location, but Docusaurus v2 sites generally have the
/docs folder inside
You are free to put the
/docs folder anywhere you want after having migrated to v2.
There are multiple things to migrate to obtain a fully functional Docusaurus 2 website:
- CLI 命令
- Markdown 文件
- 页面、 组件和 CSS
- i18n 支持🚧
The migration cli will handle many things of the migration for you.
However, some parts can't easily be automated, and you will have to fallback to the manual process.
We recommend running the migration cli, and complete the missing parts thanks to the manual migration process.
Some parts of the migration can't be automated (particularly the pages), and you will have to migrate them manually.
The manual migration guide will give you all the manual steps.
For any questions, you can ask in the
#docusaurus-1-to-2-migration Discord channel.
Feel free to tag @slorber in any migration PRs if you would like us to have a look.
We also have volunteers willing to help you migrate your v1 site.