|
1 |
| -# Website |
| 1 | +# Fluid Website Sources |
2 | 2 |
|
3 | 3 | This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
4 | 4 |
|
5 |
| -### Installation |
| 5 | +## Run Fluid Website Locally |
6 | 6 |
|
| 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 |
7 | 18 | ```
|
8 |
| -$ yarn |
| 19 | + |
| 20 | +2. Download node modules |
| 21 | +```bash |
| 22 | +npm install |
9 | 23 | ```
|
10 | 24 |
|
11 |
| -### Local Development |
| 25 | +### Local development (without multi-locale support) |
| 26 | + |
| 27 | +<details> |
| 28 | + |
| 29 | +<summary>with `--locale=en`</summary> |
12 | 30 |
|
| 31 | +```bash |
| 32 | +npm run start |
13 | 33 | ```
|
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 |
15 | 43 | ```
|
16 | 44 |
|
| 45 | +</details> |
| 46 | + |
| 47 | + |
17 | 48 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
18 | 49 |
|
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. |
20 | 52 |
|
| 53 | +### Build & serve |
| 54 | + |
| 55 | +```bash |
| 56 | +npm run build |
21 | 57 | ```
|
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 |
23 | 63 | ```
|
24 | 64 |
|
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 |
26 | 66 |
|
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. |
28 | 68 |
|
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: |
30 | 70 |
|
31 | 71 | ```
|
32 |
| -$ USE_SSH=true yarn deploy |
| 72 | +--- |
| 73 | +sidebar_label: What is Fluid |
| 74 | +sidebar_position: 1 |
| 75 | +slug: / |
| 76 | +--- |
33 | 77 | ```
|
34 | 78 |
|
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. |
36 | 82 |
|
| 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 | +} |
37 | 91 | ```
|
38 |
| -$ GIT_USER=<Your GitHub username> yarn deploy |
39 |
| -``` |
40 | 92 |
|
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