Chef documentation
This GitHub repository is the source for the Chef documentation published on docs.chef.io.
The chef/chef-web-docs repository contains:
- Source code for the Chef documentation theme
- Markdown files for much of the Chef Infra Client content
- Configuration files
- Vendored documentation from other repositories that are presented on docs.chef.io.
Style guide
See the Chef Documentation Style Guide for style guidance.
If you don't find style guidance in the Chef Documentation Style Guide, use Google's Style Guide or Microsoft's Style Guide.
Distributed documentation
The Chef documentation source is highly distributed and depends on Hugo modules to pull in documentation from other Chef repositories.
The content from those repositories is vendored in chef-web-docs.
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.
GitHub repositories
We source documentation from the following repositories:
We source the theme from this site from https://github.com/chef/chef-docs-theme.
DCO signoff
The fastest way to change the documentation is to edit a page on the
GitHub website using the GitHub UI.
To perform edits using the GitHub UI, click on the [edit on GitHub] link at
the top of the page that you want to edit. The link takes you to that topic's GitHub
page. In GitHub, click on the pencil icon and make your changes. You can preview
how they'll look right on the page ("Preview Changes" tab).
We also require contributors to include their DCO signoff
in the comment section of every pull request, except for obvious fixes. You can
add your DCO signoff to the comments by including Signed-off-by:, followed by
your name and email address, like this:
Signed-off-by: Haris Shefu <hshefu@example.com>
See our blog post
for more information about the DCO and why we require it.
After you've added your DCO signoff, add a comment about your proposed change,
then click on the "Propose file change" button at the bottom of the page and
confirm your pull request. The CI system will do some checks and add a comment
to your PR with the results.
The Chef Documentation Team can normally merge pull requests within seven days. We'll
fix build errors before we merge, so you don't have to
worry about passing all of the CI checks, but it might add an extra
few days. The important part is submitting your change.
Local development environment
The Chef Documentation website is built using:
To install Hugo, Node.js, pnpm, Go, and Dart Sass on Windows, run:
choco install hugo-extended nodejs golang sass pnpm
To install Hugo, Node.js, pnpm, Go, and Dart Sass on macOS, run:
brew install hugo node go sass/sass/sass pnpm
To install Hugo on Ubuntu, run:
apt install -y build-essential
snap install node --classic --channel=22
snap install hugo --channel=extended
snap install dart-sass
npm install -g pnpm
Troubleshoot your development environment
To clean your local development environment:
Run make clean_all to delete the SASS files, Javascript, and fonts.
Hugo rebuilds these the next time you run make serve.
Run make clean_all to delete the node modules used to build this site
in addition to the functions of make clean described above. Those node
modules will be reinstalled the next time you run make serve.
Build and preview the docs
You can preview documentation using one of the following:
- Submit a PR and look at the Netlify preview.
- Build the documentation locally.
Submit a PR and look at the Netlify preview
Netlify generates deploy previews of pull requests made on the chef-web-docs repository and adds a link to the pull request page.
This is automatic for members of the Chef GitHub organization; the Documentation Team can manually trigger Netlify to build previews from contributors who aren't members of the Chef GitHub organization.
Build and preview the docs locally
Build and preview using Netlify CLI
You can use the Netlify CLI to build and preview documentation locally.
This is useful for previewing redirects configured in the netlify.toml file.
Requirements:
Run netlify dev to preview the site using the Netlify CLI.
Build and preview the docs from the source repositories
- Run
make serve_ignore_vendor
Some Chef documentation is stored in private repositories so this option is only
available to Progress Chef employees.
Update documentation from other repositories
We vendor most documentation, some Javascript dependencies, and our site theme in the _vendor directory.
Update vendored content
To updated vendored content, follow these steps:
Update the content from source repository using hugo mod get. See the list of modules in the go.mod file or the module config file.
To update content to the latest commit in the main branch:
hugo mod get -u github.com/<ORG>/<REPO>/<SUBDIRECTORY>
You can also update a module to a particular Git SHA, branch, or tag. For example:
hugo mod get -u github.com/<ORG>/<REPO>/<SUBDIRECTORY>@<GIT_SHA>
Update the vendored content.
rm -rf _vendor
hugo mod tidy
hugo mod vendor
For example, to update the chef-workstation repository:
hugo mod get -u github.com/chef/chef-workstation/docs-chef-io
rm -rf _vendor
hugo mod tidy
hugo mod vendor
This will update that repository to the most recent commit.
You can also update a module to a repository tag. For example:
hugo mod get github.com/chef/chef-workstation/docs-chef-io@20.6.62
rm -rf _vendor
hugo mod tidy
hugo mod vendor
And you can update a module to a Git commit. For example:
hugo mod get github.com/chef/chef-workstation/docs-chef-io@0ad84dd5fa8
rm -rf _vendor
hugo mod tidy
hugo mod vendor
See Hugo's documentation for additional information about updating Hugo Modules.
What if Hugo doesn't update a module
Sometimes Hugo and Git are a bit difficult and won't update a module cleanly or will leave
references to older commits of a module in the go.sum file.
If you get an error indicating that Git can't find a repository that's already
added as a module, try cleaning your Hugo cache using hugo mod clean, and if that doesn't work, restart your computer.
If you still having trouble, try rebuilding the go.mod and go.sum files:
- Delete the
go.mod and go.sum files.
- Re-initialize the Hugo modules,
hugo mod init github.com/chef/chef-web-docs
This will generate a new, blank go.mod file.
- Update the references to the other GitHub repositories,
hugo mod get -u.
- The previous step will update all modules to the latest commit of their source
repositories.
If you don't want that, look at the git history of those files and manually edit the
go.mod and go.sum files to keep the older commits for the modules that
you don't want to update.
- Run
hugo mod tidy. This probably won't do anything on newly initialized go.mod
and go.sum files, but it can't hurt either.
- Vendor the modules in chef-web-docs,
hugo mod vendor.
Docs site theme
The theme for this site is sourced from chef/chef-docs-theme.
Update theme
The Makefile provides commands to update the theme and synchronize its packages:
make update_theme updates the theme module version, then runs make update_packages to rebuild vendored content and synchronize packages.
make update_packages rebuilds vendored content, regenerates package.json from the selected modules, and rebuilds pnpm-lock.yaml from fresh resolutions using the required Harness registry.
It updates packages within the theme's declared ranges, records explicit tarball URLs, and validates the final lockfile with a clean pnpm install --frozen-lockfile.
It doesn't fetch a newer theme version.
make update_transitive_deps rebuilds transitive dependency resolutions while preserving installed direct dependency versions and the original package.json.
It requires an existing installation and lockfile, verifies that direct versions remain unchanged, and validates a clean frozen install.
If it fails, it restores the original manifest and lockfile.
To update the theme and synchronize its packages, run:
make update_theme
To use a specific theme branch, tag, or commit instead, run:
hugo mod get github.com/chef/chef-docs-theme@<THEME_REF>
make update_packages
Replace <THEME_REF> with the branch name, tag, or commit SHA.
Run make update_packages