Skip to main content

Introduction

Use Docusaurus 3.5.2 build a static page sample project of the document manual, and other projects can use this template for secondary modification.

Demand

Project structure

The highlighted part is the multi-version management part
docs-guides
├── blog # 博客文章目录
│ └── 2020-05-30-hola.md
├── docs # 文档目录
│ ├── doc1.md
│ ├── doc2.md
│ ├── doc3.md
│ └── mdx.md
├── i18n
│ └── zh-Hans # 简体中文翻译位置
│ ├── docusaurus-plugin-content-docs
│ │ ├── current
│ │ │ ├── ... # 要与 docs 目录结构相同的文件翻译
│ │ │ └── doc1.md
│ │ ├── version-1.0
│ │ │ ├── ... # 要与 docs 目录结构相同的文件翻译
│ │ │ └── doc1.md
│ │ └── current.json # 侧边栏
│ ├── docusaurus-theme-classic
│ │ └── navbar.json # 导航栏
│ ├── docusaurus-plugin-content-blog
│ │ ├── ... # 要与 blog 目录结构相同的文件翻译
│ │ └── doc1.md
│ └── code.json # 定义了 React 代码中使用的所有文本标签
├── src # 页面或自定义的 React 组件目录
│ ├── css
│ │ └── custom.css
│ └── pages
│ ├── styles.module.css
│ └── index.js
├── static # 静态文件目录
│ └── img
├── versioned_docs # 页面或自定义的 React 组件目录
│ └── version-1.0/
├── versioned_sidebars # 页面或自定义的 React 组件目录
│ └── version-1.0-sidebars.json
├── babel.config.js
├── docusaurus.config.ts # 配置文件目录
├── package.json # 项目依赖管理
├── README.md # 项目解释 README
├── sidebars.ts # 文档侧边栏配置文件
├── tsconfig.json
└── versions.json
# clone project
git clone https://github.com/RootCluster/Docs-Guides.git
# install dependency
cd docs-guides && yarn install

# Local preview, default en
yarn start
# Specify language preview
yarn run start --locale zh-Hans
# build
yarn build


# How to upgrade
# You need to manually select the upgraded dependency package, press the space bar to select, a key to switch all, i key to reverse selection.
yarn upgrade-interactive --latest

# if use npm, npm install npm-check package
npm install -g npm-check
# check npm, a key to switch all, i key to reverse selection
npm-check -u

Config adjustment

Can refer to Docusaurus config

Style

Docusaurus classic style, has home page docs

Integrated functions

Other