If you do not want to install the dependent components locally, refer to the following How Docker Environments Work. The project source code is based on docusaurus v2.4.1, so to compile and run this project, you need to ensure that the Node. JS is installed.
- Node.js version 16.14+
-
npm install
-
npm run start
(When started in this way, the English page cannot be accessed if access is required tonpm run start-en
start) -
Browser input
# 中文模式启动
http://localhost:3000/zh-cn
# 英文模式启动
http://localhost:3000/en-us
-
npm run build
-
npm run serve
-
Browser input
http://localhost:3000/zh-cn
Make sure Docker is installed on the local machine.
- Build the mirror
docker build --target development -t docs:dev .
- Run the container
docker run -p 3000:3000 docs:dev
- Build the mirror
docker build -t sca-site:latest .
- Run the container
docker run --rm -p 3000:80 sca-site:latest
Note that if you are using npm run start
or npm run start-en
starting a Web site project in development mode, the regional language conversion feature and the local search feature will not work. Run the site project using npm run build & npm run server
in production mode to enable locale switching and site-wide search.
- A placeholder file is added at the
docs
versioned_docs
position corresponding to the folder under the root directory; - Add a new markdown file under
i18n/en-us/docusaurus-plugin-content-docs/version
ori18n/zh-cn/docusaurus-plugin-content-docs/version
. Corresponding to English and Chinese files, the Chinese and English file names shall be consistent with thedocs
placeholder files; - Add the corresponding entry in the
sidecar.json
file under theversioned_sidecar
corresponding version.
- At
i18n/en-us/docusaurus-plugin-content-docs/current/developers
or Add a new markdown file underi18n/zh-cn/docusaurus-plugin-content-docs/current/developers
. The file name should be \ End of _ dev. MD. Note the suffix \ _ dev, which is necessary; - Update the
sidebar.js
to add a new entry in en-us or zh-cn.
- Add a new markdown under
i18n/en-us/docusaurus-plugin-content-blog/current
ori18n/zh-cn/docusaurus-plugin-content-blog/current
paper. Corresponding to English and Chinese, the Chinese and English file names shall be consistent with the placeholder file names; - Add SEO configuration in the file header.
the type is :
---
title: title
keywords: [keywords1,keywords2]
description: some description
author: author name
date: 2018-12-29
custom_edit_url: https://github.com/spring-cloud-alibaba-group/spring-cloud-alibaba-group.github.io/blob/master/i18n/en-us/docusaurus-plugin-content-blog/SCA-2022.0.0.0-version-released.md
---
Notice
title
cannot contain ":";keywords
Must beArray
;custom_edit_url
Is a link to the documentation in the github repository.
- Do not use incorrect HTML tags, such as
<img>, <br>
, replace with<img/> <br/>
; - Replace with
<xx>
if you want to display<xx>
.