|
1 | | -# Running mdBook |
| 1 | +# Kubebuilder Documentation |
2 | 2 |
|
3 | | -The kubebuilder book is served using [mdBook](https://github.com/rust-lang-nursery/mdBook). If you want to test changes to the book locally, follow these directions: |
| 3 | +This is the Chinese translation of the Kubebuilder project documentation, based on the [official documentation](https://github.com/kubernetes-sigs/kubebuilder). |
4 | 4 |
|
5 | | -1. Follow the instructions at [https://rust-lang.github.io/mdBook/guide/installation.html](https://rust-lang.github.io/mdBook/guide/installation.html) to |
6 | | - install mdBook. |
7 | | -2. Make sure [controller-gen](https://pkg.go.dev/sigs.k8s.io/controller-tools/cmd/controller-gen) is installed in `$GOPATH`. |
8 | | -3. cd into the `docs/book` directory |
9 | | -4. Run `mdbook serve` |
10 | | -5. Visit [http://localhost:3000](http://localhost:3000) |
| 5 | +## Translation Base |
11 | 6 |
|
12 | | -# Steps to deploy |
| 7 | +This translation is based on the following commit: |
| 8 | +- **Source commit**: `3fd04199acb4556376dc17a7393bfd43bcd40c26` |
13 | 9 |
|
14 | | -There are no manual steps needed to deploy the website. |
| 10 | +## Local Development |
15 | 11 |
|
16 | | -Kubebuilder book website is deployed on Netlify. |
17 | | -There is a preview of the website for each PR. |
18 | | -As soon as the PR is merged, the website will be built and deployed on Netlify. |
| 12 | +### Quick Start |
| 13 | + |
| 14 | +```bash |
| 15 | +# Build and start local server |
| 16 | +./book/install-and-build.sh build |
| 17 | +cd book && mdbook serve |
| 18 | + |
| 19 | +# Visit http://localhost:3000 |
| 20 | +``` |
| 21 | + |
| 22 | +### Manual Installation (Optional) |
| 23 | + |
| 24 | +If you need to install dependencies manually: |
| 25 | + |
| 26 | +1. Install [mdBook](https://rust-lang.github.io/mdBook/guide/installation.html) |
| 27 | +2. Make sure [controller-gen](https://pkg.go.dev/sigs.k8s.io/controller-tools/cmd/controller-gen) is installed |
| 28 | +3. Run `mdbook serve` |
| 29 | + |
| 30 | +## Deployment |
| 31 | + |
| 32 | +### Automatic Deployment |
| 33 | + |
| 34 | +Pushing to `main` branch will automatically trigger GitHub Actions deployment to Cloudflare Pages. |
| 35 | + |
| 36 | +### Manual Deployment |
| 37 | + |
| 38 | +```bash |
| 39 | +# Required environment variables: |
| 40 | +# CLOUDFLARE_API_TOKEN |
| 41 | +# CLOUDFLARE_ACCOUNT_ID |
| 42 | + |
| 43 | +./deploy-cloudflare.sh |
| 44 | +``` |
0 commit comments