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
@@ -18,7 +18,7 @@ If you don't find style guidance in the Chef Documentation Style Guide, use [Goo
18
18
## Distributed documentation
19
19
20
20
The Chef documentation source is highly distributed and depends on [Hugo modules](https://gohugo.io/hugo-modules/) to pull in documentation from other Chef repositories.
21
-
The content from those repositories is [vendored](#hugo-vendoring) in chef-web-docs.
21
+
The content from those repositories is [vendored](#update-documentation-from-other-repositories) in chef-web-docs.
22
22
23
23
To make changes to the content in those repositories, submit pull requests to the appropriate repository. don't submit pull requests to the vendored files in chef-web-docs. We will update those changes after they're merged or after a new version of a product is released.
24
24
@@ -70,25 +70,11 @@ fix build errors before we merge, so you don't have to
70
70
worry about passing all of the CI checks, but it might add an extra
71
71
few days. The important part is submitting your change.
72
72
73
-
## Edit on GitHub links
74
-
75
-
We use a partial `edit_on_github.html` to add "Edit on GitHub" links to each page.
76
-
77
-
Each page should have a `gh_repo` parameter set to the value of the GitHub repository
78
-
that the page comes from. For example, `gh_repo = "chef-server"`
79
-
80
-
Each repository with documentation has a `config.toml` file with a `params.<REPOSITORY>`
81
-
map and a `gh_path` parameter set to the path of the docs content directory in
82
-
that repository.
83
-
84
-
The `edit_on_github` partial appends the page file name to the end of `gh_path`
85
-
parameter and adds the link to the text of the page.
86
-
87
73
## Local development environment
88
74
89
75
The Chef Documentation website is built using:
90
76
91
-
-[Hugo](https://gohugo.io/) 0.123.4 or higher
77
+
-[Hugo](https://gohugo.io/) 0.142.0 or higher
92
78
-[Node](https://www.nodejs.com) 20.0.0 or higher
93
79
-[NPM](https://www.npmjs.com/) 10.4.0 or higher
94
80
-[Go](https://golang.org/dl/) 1.22 or higher
@@ -124,61 +110,6 @@ To clean your local development environment:
124
110
in addition to the functions of `make clean` described above. Those node
125
111
modules will be reinstalled the next time you run `make serve`.
126
112
127
-
## Site theme
128
-
129
-
The theme for this site is deployed from the [chef/chef-docs-theme](https://github.com/chef/chef-docs-theme/) repository.
130
-
131
-
### Node modules
132
-
133
-
The Node modules defined in the `package.json` file are sourced from the `package.hugo.json` file in the `chef/chef-docs-theme` repository.
134
-
To update these Node dependencies, update them in `chef/chef-docs-theme`, then [update the theme and the `package.json` file](#update-theme) in this repository.
135
-
136
-
### Local theme testing
137
-
138
-
You can test local changes made to the chef-docs-theme repository and preview those changes using Hugo's local development server.
139
-
To do this, create a Go workspace file that modifies the source of Hugo's modules, source the workspace file, and start the local server.
140
-
141
-
For example:
142
-
143
-
1. Create a `hugo.work` file in root of this project.
144
-
145
-
1. Add the following config information to the `hugo.work` file:
146
-
147
-
```go
148
-
go1.22
149
-
150
-
use .
151
-
use ../path/to/local/chef-docs-theme
152
-
```
153
-
154
-
1. Start the Hugo local server:
155
-
156
-
```sh
157
-
make test_theme
158
-
```
159
-
160
-
This command adds the `hugo.work` file to the Hugo workspace and then ignores the contents of `chef-docs-theme` repo in the `_vendor` directory.
161
-
162
-
### Test theme branch
163
-
164
-
You can target a Git commit, branch, or tag when importing a module. This allows you to push a test branch up to `chef/chef-docs-theme` and then import it into this repository for local testing.
165
-
166
-
For example:
167
-
168
-
```sh
169
-
hugo mod get -u github.com/chef/chef-docs-theme@<GIT_COMMIT_SHA>
170
-
```
171
-
172
-
or
173
-
174
-
```sh
175
-
hugo mod get -u github.com/chef/chef-docs-theme@<GIT_BRANCH>
176
-
```
177
-
178
-
### Update theme
179
-
180
-
Run `make update_theme` to update the chef-docs-theme to the latest commit. This updates the theme and the theme's node dependencies.
181
-
182
113
## Build and preview the docs
183
114
184
115
You can preview documentation using one of the following:
@@ -193,6 +124,7 @@ This is automatic for members of the Chef GitHub organization; the Documentation
193
124
194
125
### Build and preview the docs locally
195
126
127
+
-[Install the site dependencies](#local-development-environment).
196
128
- Run `make serve`
197
129
- go to [http://localhost:1313](http://localhost:1313)
198
130
@@ -203,7 +135,7 @@ This is useful for previewing redirects configured in the `netlify.toml` file.
203
135
204
136
Requirements:
205
137
206
-
- all the requirements for building this site locally
138
+
-[all the requirements for building this site locally](#local-development-environment)
Run `netlify dev` to preview the site using the Netlify CLI.
@@ -215,89 +147,74 @@ Run `netlify dev` to preview the site using the Netlify CLI.
215
147
Some Chef documentation is stored in private repositories so this option is only
216
148
available to Progress Chef employees.
217
149
218
-
## Hugo vendoring
150
+
## Update documentation from other repositories
219
151
220
-
[Vendoring](https://gohugo.io/commands/hugo_mod_vendor/) stores all of the module content
221
-
from other repositories in the `_vendor` directory at the commit specified by
222
-
the `go.mod` file. WhenHugo builds the documentation, it will grab content from
223
-
the `_vendor` directory instead of the original repository OR a local copy of a
224
-
that repository. To see which commits the vendored files reference, see the
225
-
`_vendor/modules.txt` file.
152
+
We [vendor](https://gohugo.io/commands/hugo_mod_vendor/) most documentation, some Javascript dependencies, and our site theme in the `_vendor` directory.
226
153
227
-
To vendor the modules in chef-web-docs, run `hugo mod vendor`.
154
+
### Update vendored content
228
155
229
-
To update the vendored modules, first update the [Hugo module(s)](#update-hugo-modules),
230
-
then run `hugo mod vendor`.
156
+
To updated vendored content, follow these steps:
231
157
232
-
To ignore the vendored files in a Hugo build, run `make serve_ignore_vendor`. This
233
-
is the same as `make serve` except it adds the `--ignoreVendor` flag. This will
234
-
build the documentation from the GitHub repositories or from a local copy of a repository
235
-
if the `go.mod` file specifies pulling content from a local repository. (see above)
158
+
1. Update the content from source repository using [`hugo mod get`](https://gohugo.io/commands/hugo_mod_get/). See the list of modules in the [`go.mod` file](https://github.com/chef/chef-web-docs/blob/main/go.mod) or the [module config file](https://github.com/chef/chef-web-docs/blob/main/config/_default/module.toml).
236
159
237
-
### UpdateHugo modules
160
+
To update content to the latest commit in the main branch:
238
161
239
-
Hugo modules are pinned to a particular commit of the master branch in their repository.
240
-
If you look in the `go.mod` and `go.sum` files, you'll notice that each repository
241
-
specifies a git commit timestamp and SHA.
162
+
```sh
163
+
hugo mod get -u github.com/<ORG>/<REPO>/<SUBDIRECTORY>
164
+
```
242
165
243
-
To update a particular repo, run:
166
+
You can also update a module to a particular Git SHA, branch, or tag. For example:
244
167
245
-
```bash
246
-
hugo mod get github.com/chef/repo_to_update/subdirectory
247
-
hugo mod clean
248
-
```
168
+
```sh
169
+
hugo mod get -u github.com/<ORG>/<REPO>/<SUBDIRECTORY>@<GIT_SHA>
170
+
```
249
171
250
-
Then [vendor](#hugo-vendoring) the documentation:
172
+
1. Update the vendored content.
251
173
252
-
```bash
253
-
hugo mod vendor
254
-
```
174
+
```sh
175
+
rm -rf _vendor
176
+
hugo mod tidy
177
+
hugo mod vendor
178
+
```
255
179
256
180
For example, to update the chef-workstation repository:
257
181
258
182
```bash
259
-
hugo mod get github.com/chef/chef-workstation/docs-chef-io
260
-
hugo mod clean
183
+
hugo mod get -u github.com/chef/chef-workstation/docs-chef-io
184
+
rm -rf _vendor
185
+
hugo mod tidy
261
186
hugo mod vendor
262
187
```
263
188
264
189
This will update that repository to the most recent commit.
265
190
266
-
You can also update a module to a commit version number. For example:
191
+
You can also update a module to a repository tag. For example:
And you can update a module to a Git commit. For example:
275
201
276
202
```sh
277
203
hugo mod get github.com/chef/chef-workstation/docs-chef-io@0ad84dd5fa8
278
-
hugo mod clean
204
+
rm -rf _vendor
205
+
hugo mod tidy
279
206
hugo mod vendor
280
207
```
281
208
282
-
The `hugo mod clean` command removes references to commits in the
283
-
`go.mod` and `go.sum` files that are no longer relevant.
284
-
285
-
See Hugo's [documentation](https://gohugo.io/hugo-modules/use-modules/#update-modules)
286
-
for additional information about updating HugoModules.
287
-
288
-
### Update chef-docs-theme module
289
-
290
-
The theme for this site is sourced from [chef/chef-docs-theme](https://github.com/chef/chef-docs-theme).
291
-
292
-
Run `make update_theme` to update the theme module and Nodepackage dependencies.
209
+
See [Hugo's documentation](https://gohugo.io/hugo-modules/use-modules/#update-modules) for additional information about updating Hugo Modules.
293
210
294
211
### What if Hugo doesn't update a module
295
212
296
213
Sometimes Hugo and Git are a bit difficult and won't update a module cleanly or will leave
297
214
references to older commits of a module in the `go.sum` file.
298
215
299
216
If you get an error indicating that Git can't find a repository that's already
300
-
added as a module, try restarting your computer.
217
+
added as a module, try cleaning your Hugo cache using `hugo mod clean`, and if that doesn't work, restart your computer.
301
218
302
219
If you still having trouble, try rebuilding the `go.mod` and `go.sum` files:
303
220
@@ -314,6 +231,82 @@ If you still having trouble, try rebuilding the `go.mod` and `go.sum` files:
314
231
and `go.sum` files, but it can't hurt either.
315
232
1. Vendor the modules in chef-web-docs, `hugo mod vendor`.
316
233
234
+
## Docs site theme
235
+
236
+
The theme for this site is sourced from [chef/chef-docs-theme](https://github.com/chef/chef-docs-theme).
237
+
238
+
### Update theme
239
+
240
+
Run `make update_theme` to update the site theme.
241
+
242
+
### Update theme Javascript dependencies
243
+
244
+
We source Javascript dependencies in the chef/chef-docs-theme repository using Node and GitHub.
245
+
246
+
#### Node dependencies
247
+
248
+
To update first-level Node dependencies:
249
+
250
+
1. Update the dependency in the [chef/chef-docs-theme package.hugo.json file](https://github.com/chef/chef-docs-theme/blob/main/package.hugo.json).
251
+
2. Update the [package.json file in chef/chef-docs-theme](https://github.com/chef/chef-docs-theme/blob/main/package.json) by running `hugo mod npm pack`
252
+
3. Commit the package file updates to main in chef/chef-docs-theme.
253
+
4. Update the theme in this repo by running `make update_theme`.
254
+
255
+
To update transitive Node dependencies in this repo:
256
+
257
+
- Run `npm update`.
258
+
259
+
#### Javascript dependencies imported with Hugo
260
+
261
+
We use Hugo to import JavaScript dependencies from GitHub repositories. You can see the full list in either the chef/chef-docs-theme [go.mod file](https://github.com/chef/chef-docs-theme/blob/main/go.mod) or the [`hugo.toml` file](https://github.com/chef/chef-docs-theme/blob/main/hugo.toml).
262
+
263
+
To update these dependencies, follow these steps:
264
+
265
+
1. Update the dependency in the go.mod file in chef/chef-docs-theme using the [`hugo mod get -u` command](https://gohugo.io/commands/hugo_mod_get/).
266
+
2. Tidy the go.sum file with `hugo mod tidy`.
267
+
3. Commit the changes to chef/chef-docs-theme
268
+
4. Update the theme contents in this repo with `make update_theme`.
269
+
270
+
### Local theme testing
271
+
272
+
You can testlocal changes made to the chef-docs-theme repository and preview those changes using Hugo's local development server.
273
+
To do this, create a Go workspace file that modifies the source of Hugo's modules, source the workspace file, and start the local server.
274
+
275
+
For example:
276
+
277
+
1. Create a `hugo.work` file in root of this project.
278
+
279
+
1. Add the following config information to the `hugo.work` file:
280
+
281
+
```go
282
+
go 1.22
283
+
284
+
use .
285
+
use ../path/to/local/chef-docs-theme
286
+
```
287
+
288
+
1. Start the Hugo local server:
289
+
290
+
```sh
291
+
make test_theme
292
+
```
293
+
294
+
This command adds the `hugo.work` file to the Hugo workspace and then ignores the contents of `chef-docs-theme` repo in the `_vendor` directory.
295
+
296
+
## Edit on GitHub links
297
+
298
+
We use a partial `edit_on_github.html` to add "Edit on GitHub" links to each page.
299
+
300
+
Each page should have a `gh_repo` parameter set to the value of the GitHub repository
301
+
that the page comes from. For example, `gh_repo = "chef-server"`
302
+
303
+
Each repository with documentation has a `config.toml` file with a `params.<REPOSITORY>`
304
+
map and a `gh_path` parameter set to the path of the docs content directory in
305
+
that repository.
306
+
307
+
The `edit_on_github` partial appends the page file name to the end of `gh_path`
308
+
parameter and adds the link to the text of the page.
309
+
317
310
## Release notes
318
311
319
312
Release notes are added to release notes pages using Hugo's [`resource.getRemote` function](https://gohugo.io/hugo-pipes/introduction/#get-resource-with-resourcesget-and-resourcesgetremote) and content from [https://omnitruck.chef](omnitruck.chef.io) and [https://packages.chef.io](packages.chef.io).
@@ -362,7 +355,7 @@ The commit history of this repo before February 12, 2016 has been archived to th
362
355
We love getting feedback. You can use:
363
356
364
357
- Each page has a feedback form at the bottom of the page.
365
-
- Email --- Send an email to chef-docs@progress.comfor documentation bugs,
358
+
- Email --- Send an email to <[email protected]>for documentation bugs,
366
359
ideas, thoughts, and suggestions. This email address isn't a
367
360
support email address, however. If you need support, contact Chef
0 commit comments