Skip to content

Commit 991e6d9

Browse files
committed
Clarify docusaurus usage in README.md
Signed-off-by: trafalgarzzz <[email protected]>
1 parent 5c78fb2 commit 991e6d9

File tree

1 file changed

+70
-15
lines changed

1 file changed

+70
-15
lines changed

README.md

+70-15
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,96 @@
1-
# Website
1+
# Fluid Website Sources
22

33
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

5-
### Installation
5+
## Run Fluid Website Locally
66

7+
### Requirements
8+
- [Node.js](https://nodejs.org/en/download/) version 18.0 or above
9+
10+
### Setup
11+
12+
1. Clone the repo to your workspace
13+
```bash
14+
mkdir -p /path/to/workspace
15+
cd /path/to/workspace/
16+
git clone https://github.com/fluid-cloudnative/fluid-cloudnative.github.io.git fluid-website
17+
cd fluid-website
718
```
8-
$ yarn
19+
20+
2. Download node modules
21+
```bash
22+
npm install
923
```
1024

11-
### Local Development
25+
### Local development (without multi-locale support)
26+
27+
<details>
28+
29+
<summary>with `--locale=en`</summary>
1230

31+
```bash
32+
npm run start
1333
```
14-
$ yarn start
34+
35+
</details>
36+
37+
<details>
38+
39+
<summary>with `--locale=zh`</summary>
40+
41+
```bash
42+
npm run start --locale=zh
1543
```
1644

45+
</details>
46+
47+
1748
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1849

19-
### Build
50+
> [!NOTE]
51+
> Currently `localeDropdown` won't work in local development mode because of technical limitation(see related issue [here](https://github.com/facebook/docusaurus/issues/7377)). Please use `npm run serve` instead as a workaround.
2052
53+
### Build & serve
54+
55+
```bash
56+
npm run build
2157
```
22-
$ yarn build
58+
59+
This command generates static content into the `build` directory and can be served using any static contents hosting service. This includes multilingual contents so it would work with `localeDropdown`.
60+
61+
```bash
62+
npm run serve
2363
```
2464

25-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
65+
## Make Changes to Website
2666

27-
### Deployment
67+
To make changes to the website, add or modify markdown files under `docs/` for en version and `i18n/zh/docusaurus-plugin-content-docs/` for zh version. Any commits pushed to the repo will trigger a Github workflow to re-deploy the website with the latest changes.
2868

29-
Using SSH:
69+
Any markdown files should have a header to control its appearance on the website, Take [`docs/core-concepts/what-is-fluid.md`](./docs/core-concepts/what-is-fluid.md) as an example, the header looks like:
3070

3171
```
32-
$ USE_SSH=true yarn deploy
72+
---
73+
sidebar_label: What is Fluid
74+
sidebar_position: 1
75+
slug: /
76+
---
3377
```
3478

35-
Not using SSH:
79+
- `sidebar_label` indicates the label name showed in the sidebar of the website.
80+
- `sidebar_position` indicates the sequential order under a sidebar folder.
81+
- `slug` indicates the relative url path to the website.
3682

83+
For each directory under `docs/`, a special file `_category_.json` is needed to control the doc folder's appearance on the website:
84+
85+
```json
86+
{
87+
"label": "Core Concepts",
88+
"position": 1,
89+
"link": null
90+
}
3791
```
38-
$ GIT_USER=<Your GitHub username> yarn deploy
39-
```
4092

41-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
93+
- `label` indicates the doc folder's name to be showed on the website.
94+
- `position` indicates the sequential order among all the sidecar folders.
95+
- `link` indicates whether a category page is needed for the sidecar folder.
96+

0 commit comments

Comments
 (0)