This guide explains the options and configuration files available for the Teleport docs site.
File that configures build options:
versions
- array of the available options, should match the names of the folders insidecontent
dir. Will be shown in the version select in inverted order.redirects
- optional array of redirects. Uses Next.js syntax inside.
Format of version entry:
name
- required. Name of the folder incontent
and name of branch in version's dropdown on the site.branch
- required. Name of branch for this version. Will be used foredit
links on the docs pages.latest
- not required. First entry with this field will be current version. If no entries have this field, then the last version in array will be considered the latest.
- Add new submodule:
git submodule add -b branch/*.* https://github.com/gravitational/teleport/ content/*.*
wherebranch/*.*
is the name of the branch in the main Teleport repo andcontent/*.*
is the name of the subfolder in thecontent
folder where the docs will be stored. Name of the folder insidecontent
should match the name of the version in the config. Folder name itself can contain any characters allowed in the URL. E.g.6.0-rc
. - Add new entry to the
versions
array inconfig.json
with name and branch field. - Change
latest
field to the new value if you want to make it the default.
- Open
.gitmodules
file. - Find corresponding record. For example, for version
4.4
it will look like this:[submodule "content/4.4"] path = content/4.4 url = https://github.com/gravitational/teleport/ branch = branch/4.4
- Change
branch
field to the new branch name. - Run
yarn git-update
– this will update all submodules to the HEAD commits of the corresponding branches.
Correct way to remove submodule:
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
At the root of the project, create an .env.local
file. Inside this file, add the YOUTUBE_API_KEY
variable with the API key's value:
YOUTUBE_API_KEY=[key-for-google-api]
Get the API key via these instructions.