All website material of https://seata.apache.org, which uses a open source framework: Docusaurus.
npm install
npm run start
for starting Seata's English webpage in your local machine.
npm run start-zh-cn
for starting Seata's Chinese Simplified webpage in your local machine.
Visit
localhost:3000/
npm run build
npm run serve
Visit
localhost:3000/
Base docusaurus 2.4.1 Node.js version 19.5.0
Please be noted that locale switching function doesn't work if you start the website in development mode using npm run start-zh-cn
or npm run start
. Please run it in production mode using the build-and-serve process to enable the locale switching function.
We use the Docusaurus internationalization (i18n) to support both English(en) and Chinese Simplified(zh-cn) Seata Website. Besides, we apply Docusaurus Versioning to get versioned docs.
Our website stucture with i18n and versioning looks like below:
website
├── sidebars.json # sidebar for the current docs version
├── docs # docs directory for the current docs version
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/next/foo/bar
│ └── hello.md # https://mysite.com/docs/next/hello
├── versions.json # file to indicate what versions are available
├── versioned_docs
│ ├── version-1.1.0
│ │ ├── foo
│ │ │ └── bar.md # https://mysite.com/docs/foo/bar
│ │ └── hello.md
│ └── version-1.0.0
│ ├── foo
│ │ └── bar.md # https://mysite.com/docs/1.0.0/foo/bar
│ └── hello.md
├── versioned_sidebars
│ ├── version-1.1.0-sidebars.json
│ └── version-1.0.0-sidebars.json
├── blog
├── docusaurus.config.js
├── package.json
├── i18n
│ ├── en
│ │ ├── docusaurus-plugin-content-docs
│ │ │ ├── current
│ │ │ ├── version-1.0.0
│ │ │ └── version-1.1.0
│ │ ├── docusaurus-plugin-content-blog
│ │ └── ...
│ └── zh-cn
│ │ ├── docusaurus-plugin-content-docs
│ │ │ ├── current
│ │ │ ├── version-1.0.0
│ │ │ └── version-1.1.0
│ │ ├── docusaurus-plugin-content-blog
│ │ └── ...
docs - Contain the current (latest version) documents (placeholder for sidebar indexing purposes)
Document Content should be Placeholder. DO NOT DELETE.
sidebars.json - Set the sidebar for the current (latest version) documents.
versioned_docs - Contain the previous version documents (placeholder for sidebar indexing purposes)
Document Content should be Placeholder. DO NOT DELETE.
versioned_sidebars - Set the sidebar for the specific previous versions documents.
i18n-en
-docusaurus-plugin-content-docs-current
- Contain the actual latest version English documents.
i18n-en
-docusaurus-plugin-content-docs-version-1.0.0
- Contain the actual 1.0.0 version English documents.
i18n-zh-cn
-docusaurus-plugin-content-docs-current
- Contains the actual latest version Simplified Chinese documents.
i18n-zh-cn
-docusaurus-plugin-content-docs-version-1.0.0
- Contain the actual 1.0.0 version Simplified Chinese documents.
Steps to add a document for the latest version:
en
-docusaurus-plugin-content-docs-current
directory.zh-cn
-docusaurus-plugin-content-docs-current
directory.Steps to add a document for a previous version:
en
-docusaurus-plugin-content-docs-specific version number
directory.zh-cn
-docusaurus-plugin-content-docs-specific version number
directory.Notes: Corresponding to Chinese file and English file of same contents, and the Chinese and English file names should be consistent.
We don't have a versioned blog, so it's easier to add a blog. When adding a new blog, it is automatically added in the Blog sidebar, where the order of blogs is sorted by the date
field in SEO in the blog file.
blog - Contain the blogs(placeholder for blog sidebar indexing purposes)
Blog Content should be Placeholder. DO NOT DELETE.
i18n-en
-docusaurus-plugin-content-blog - Contain all the actual English blogs.
i18n-zh-cn
-docusaurus-plugin-content-blog - Contain all the actual Simplified Chinese blogs.
Steps to add a blog:
en
-docusaurus-plugin-content-blog directory.zh-cn
-docusaurus-plugin-content-blog directory.Notes: Corresponding to Chinese file and English file of same contents, and the Chinese and English file names should be consistent.
The type is:
---
title: title
keywords: [keywords1,keywords2]
description: some description
author: author name
date: 2018-12-29
custom_edit_url: https://github.com/apache/incubator-seata-website/blob/docusaurus/i18n/en/docusaurus-plugin-content-blog/quick-start-use-seata-and-dubbo-services.md
---
Note:
title
can not include :
keywords
must be a Array
<img>、<br>
, replace with <img /> <br />
<xx>
, replace with <xx>
npm run lint
to check the style.This is official Docusaurus docs: https://docusaurus.io/docs