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
When developing documentation, there are steps to take before submitting a pull request
4
+
5
+
1. Writing your documentation with [hot reloading](#development-with-hot-reloading) live in your browser
6
+
2. Verifying your changes with a [production build](#mimic-production-environment) to ensure Hugo will minify everything correctly
7
+
8
+
## Development with Hot Reloading
9
+
10
+
This method performs the following from the `django-DefectDojo/docs` directory:
11
+
12
+
1. Remove any existing packages to perform a fresh install each time: `rm -rf public node_modules`
13
+
2. Install all packages: `npm install`
14
+
3. Start the server: `npm run dev`
15
+
4. Access the [site in the browser at http://localhost:1313](http://localhost:1313)
16
+
17
+
### Execution List
18
+
19
+
```bash
20
+
rm -rf public node_modules
21
+
npm install
22
+
npm run dev
23
+
```
24
+
25
+
or for a one liner:
26
+
27
+
```bash
28
+
rm -rf public node_modules && \
29
+
npm install && \
30
+
npm run dev
31
+
```
32
+
33
+
## Mimic Production Environment
34
+
35
+
This method performs the following from the `django-DefectDojo/docs` directory:
36
+
37
+
1. Remove any existing packages to perform a fresh install each time: `rm -rf public node_modules`
38
+
2. Install all packages in CI mode to only install from `package-lock.json`: `npm ci`
39
+
3. Run Hugo to build the site in the way the CI job does, but in development environment to point at `localhost` for integrity checks : `npm run build -- --environment development`
40
+
4. Change directory to the new `public` directory to run the site locally: `cd public`
41
+
5. Run a light weight webserver to server the files, and [access the site at http://localhost:8080](http://localhost:8080): `python3 -m http.server 8080`
42
+
6. After killing the webserver process, navigate back to the `django-DefectDojo/docs` directory: `cd ../`
0 commit comments