Docusaurus 介绍
⚡️ Docusaurus will help you ship a beautiful documentation site in no time.
💸 自己造轮子是一件苦差事。 Instead, focus on your content and just write Markdown files.
💥 想深入了解吗? Use advanced features like versioning, i18n, search and theme customizations.
💅 Check the best Docusaurus sites for inspiration and read some testimonials.
🧐 Docusaurus is a static-site generator. It builds a single-page application with fast client-side navigation, leveraging the full power of React to make your site interactive. It provides out-of-the-box documentation features but can be used to create any kind of site (personal website, product, blog, marketing landing pages, etc).
Fast Track ⏱️
Understand Docusaurus in 5 minutes by playing!
Create a new Docusaurus site and follow the very short embedded tutorial.
Install Node.js and create a new Docusaurus site:
npx create-docusaurus@latest my-website classic
运行网站:
cd my-website
npx docusaurus start
Open http://localhost:3000
and follow the tutorial.
Use docusaurus.new to test Docusaurus immediately in your browser!
Or read the 5-minute tutorial online.
Docusaurus: 让文档变得易于上手
In this presentation at Algolia Community Event, Meta Open Source team shared a brief walk-through of Docusaurus. 他们介绍了如何上手项目,启用插件,并设置文档和博客等功能。
Migrating from v1
Docusaurus v2 在 v1 基础上完全重写了内部逻辑,采用了一套完全现代化的工具链。 After v2's official release, we highly encourage you to use Docusaurus v2 over Docusaurus v1, as Docusaurus v1 has been deprecated.
A lot of users are already using Docusaurus v2 (trends).
Use Docusaurus v2 if:
- ✅ 你想要一个现代化的 Jamstack 文档网站
- ✅ 你想要自带客户端路由的单页应用 (SPA)
- ✅ 你想要发挥 React 和 MDX 的全部功力
- ✅ 你不需要支持 IE11
Use Docusaurus v1 if:
- ❌ 你不需要单页应用 (SPA)
- ❌ 你需要支持 IE11 (……你真的需要吗? IE has already reached end-of-life and is no longer officially supported)
For existing v1 users that are seeking to upgrade to v2, you can follow our migration guide.
Features
对于正在考虑升级到 v2 的现有的 v1 用户,你可以参考我们的迁移指南。
- ⚛️ Built with 💚 and React:
- 使用 React 实现扩展与自定义
- 提供你自己的 React 组件,从而完全掌控网站的浏览体验
- Pluggable:
- 使用基础模板搭建网站,随后使用进阶功能及插件
- 开放你的插件源码,与社区共享
- ✂️ Developer experience:
- 立即开始撰写你的软件文档
- 统一配置文件,贡献者可以轻松维护
- 热重载,飞速增量构建
- 基于路由的代码及数据拆分