You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module-check: ## Check if all of the required submodules are correctly initialized.
24
+
@git submodule status --recursive | awk '/^[+-]/ {err = 1; printf "\033[31mWARNING\033[0m Submodule not initialized: \033[34m%s\033[0m\n",$$2} END { if (err != 0) print "You need to run \033[32mmake module-init\033[0m to initialize missing modules first"; exit err }'1>&2
@@ -9,42 +9,114 @@ I put the most effort into the `Documentation` section. The left-menu bar has th
9
9
10
10
The top bar is customized with the sections I think make sense to split. However, I have customized nothing else inside the `Community`, `Contribute` and `Blog` sections.
11
11
12
-
## Building
12
+
## Running the website locally
13
+
You can run the website locally using [Hugo (Extended version)](https://gohugo.io/), or you can run it in a container runtime. We strongly recommend using the container runtime, as it gives deployment consistency with the live website.
13
14
14
-
Build and run using Docker or Hugo, then access the site at `http://localhost:1313`.
15
+
## Prerequisites
16
+
17
+
To use this repository, you need the following installed locally:
18
+
19
+
-[npm](https://www.npmjs.com/)
20
+
-[Go](https://go.dev/)
21
+
-[Hugo (Extended version)](https://gohugo.io/)
22
+
- A container runtime, like [Docker](https://www.docker.com/).
23
+
24
+
Before you start, install the dependencies. Clone the repository and navigate to the site directory:
25
+
26
+
```bash
27
+
# Clone your repository fork from the previous step
The Kustomize website uses the [Docsy Hugo theme](https://github.com/google/docsy#readme). Even if you plan to run the website in a container, we strongly recommend pulling in the submodule and other development dependencies by running the following:
33
+
34
+
### Windows
35
+
```powershell
36
+
# fetch submodule dependencies
37
+
git submodule update --init --recursive --depth 1
38
+
```
39
+
40
+
### Linux / other Unix
41
+
```bash
42
+
# fetch submodule dependencies
43
+
make module-init
44
+
```
45
+
46
+
## Running the website using a container
47
+
48
+
To build the site in a container, run the following:
49
+
50
+
```bash
51
+
# You can set $CONTAINER_ENGINE to the name of any Docker-like container tool
52
+
# Build the image
53
+
make container-image
54
+
55
+
# Run the container
56
+
make container-serve
57
+
```
58
+
59
+
If you see errors, it probably means that the hugo container did not have enough computing resources available. To solve it, increase the amount of allowed CPU and memory usage for Docker on your machine ([MacOS](https://docs.docker.com/desktop/settings/mac/) and [Windows](https://docs.docker.com/desktop/settings/windows/)).
60
+
61
+
Open up your browser to <http://localhost:1313> to view the website. As you make changes to the source files, Hugo updates the website and forces a browser refresh.
62
+
63
+
## Running the website locally using Hugo
64
+
65
+
Make sure to install the Hugo extended version specified by the `HUGO_VERSION` environment variable in the [`netlify.toml`](netlify.toml#L7) file.
66
+
67
+
To install dependencies, deploy and test the site locally, run:
68
+
69
+
- For macOS and Linux
70
+
```bash
71
+
npm ci
72
+
make serve
73
+
```
74
+
- For Windows (PowerShell)
75
+
```powershell
76
+
npm ci
77
+
hugo.exe server --buildFuture --environment development
78
+
```
79
+
80
+
This will start the local Hugo server on port 1313. Open up your browser to <http://localhost:1313> to view the website. As you make changes to the source files, Hugo updates the website and forces a browser refresh.
81
+
82
+
## Troubleshooting
83
+
84
+
### error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
85
+
86
+
Hugo is shipped in two set of binaries for technical reasons. The current website runs based on the **Hugo Extended** version only. In the [release page](https://github.com/gohugoio/hugo/releases) look for archives with `extended` in the name. To confirm, run `hugo version` and look for the word `extended`.
87
+
88
+
### Troubleshooting macOS for too many open files
89
+
90
+
If you run `make serve` on macOS and receive the following error:
0 commit comments