Skip to content

Commit 008aedb

Browse files
committed
document locale options and local previews
adds locale examples for the dev server and build commands, a section on previewing a build, and switches the deploy examples from yarn to npm.
1 parent af02914 commit 008aedb

1 file changed

Lines changed: 42 additions & 17 deletions

File tree

‎frontend/README.md‎

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,41 @@ We welcome contributions to our documentation! Whether you're fixing a typo or a
1616

1717
To preview your changes locally:
1818

19-
1. **Navigate to the frontend directory:**
20-
```bash
21-
cd frontend
22-
```
23-
2. **Install dependencies:**
24-
```bash
25-
npm install
26-
```
27-
3. **Start the development server:**
28-
```bash
29-
npm start
30-
```
31-
The site will be available at `http://localhost:3000`. Most changes to Markdown files will live-reload in the browser.
19+
1. **Navigate to the frontend directory:**
20+
21+
```bash
22+
cd frontend
23+
```
24+
25+
2. **Install dependencies:**
26+
27+
```bash
28+
npm install
29+
```
30+
31+
3. **Start the development server:**
32+
33+
```bash
34+
npm start
35+
```
36+
37+
The site will be available at `http://localhost:3000`. Most changes to Markdown files will live-reload in the browser.
38+
39+
#### Choosing a locale
40+
41+
```bash
42+
npm start -- --locale pt-BR # http://localhost:3000/pt-BR/
43+
npm start -- --locale zh-CN # http://localhost:3000/zh-CN/
44+
```
45+
46+
`start` accepts a **single** locale — a second `--locale` is silently ignored (the last one wins) — so run one dev server per language on different ports.
3247

3348
### Adding or Editing Pages
3449

3550
- To **edit** an existing page, find the corresponding `.md` file in `docs/` and make your changes.
3651
- To **add** a new page, create a new `.md` file in the appropriate subdirectory of `docs/`.
3752
- Remember to update the **metadata** (front matter) at the top of the file:
53+
3854
```markdown
3955
---
4056
title: Page Title
@@ -58,29 +74,38 @@ npm i
5874
### Local Development
5975

6076
```bash
61-
npm start
77+
npm start # default locale
78+
npm start -- --locale pt-BR # specific locale
6279
```
6380

6481
### Build
6582

6683
```bash
67-
npm run build
84+
npm run build # all locales
85+
npm run build -- --locale pt-BR # one locale
86+
npm run build -- --locale en --locale pt-BR --locale zh-CN # several locales
6887
```
6988

7089
This command generates static content into the `build` directory.
7190

91+
### Local Preview
92+
93+
```bash
94+
npm run serve
95+
```
96+
7297
### Deployment
7398

7499
Using SSH:
75100

76101
```
77-
$ USE_SSH=true yarn deploy
102+
USE_SSH=true npm run deploy
78103
```
79104

80105
Not using SSH:
81106

82107
```
83-
$ GIT_USER=<Your GitHub username> yarn deploy
108+
GIT_USER=<Your GitHub username> npm run deploy
84109
```
85110

86111
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.

0 commit comments

Comments
 (0)