* Add a docs linter for unused partials and images
Check whether any images in the `docs/img` directory or partials in the
`docs/pages/includes` directory are unused within the docs. This
prevents situations such as the following:
- An author unknowingly removes the only inclusion of a partial with
important information, which should remain in the docs.
- An author introduces an image, thinking they might use it, but ends up
using a different image, unnecessarily increasing repo size.
- An author forgets to remove unused assets, causing cluster that adds
friction for other authors trying to navigate the `docs` directory.
Implementation details:
- Add a script to `build.assets` to list unused docs assets, including
images and partials.
- Add a step to the `Lint (Docs)` workflow that checks whether the list
is nonempty and, if so, exits with an error.
* Remove unused docs partials and images
* Refactor custom installer partials
The current approach injects a parameter into partial paths within
`custom-installer.mdx` in order to load one of several partials based on
the cloud provider and whether the installer is created statically or
dynamically.
However, if we use the automated approach in
`build.assets/unused-docs-assets.sh` to check for unused partials, it is
impossible to determine whether the partials we keep in
`docs/pages/includes` are included in the docs. This change refactors
the custom installer partials so we can use only static partial paths,
rather than dynamic ones.
* Apply suggestion from **hugoShaka**
Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com>
---------
Co-authored-by: Hugo Shaka <hugo.hervieux@goteleport.com>