Skip to content

Commit

Permalink
Remove /ver/ segments from Web UI docs links
Browse files Browse the repository at this point in the history
Backports #45474

The Support component is the only Web UI component that renders docs
links that include the `/ver/` path segment. This change removes the
`/ver/` path segment from these links so they point to the default
version of the docs. The user can use the version dropdown within the
docs site to adjust the version. This change does not alter UTM
parameters.

With this change, we only need to manage redirects in the default
version of the docs site. This makes it less likely that users will
encounter 404 errors. And since the docs site only displays the current
version and previous two versions, link targets with the `/ver/` segment
will 404 in EOL Teleport versions. This change also prevents that
scenario.
  • Loading branch information
ptgott committed Aug 15, 2024
1 parent 64cf82c commit 2d39f31
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions web/packages/teleport/src/Support/Support.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,13 @@ const getDocUrls = (version = '', isEnterprise: boolean) => {
const withUTM = (url = '', anchorHash = '') =>
`${url}?product=teleport&version=${verPrefix}_${version}${anchorHash}`;

let docVer = '';
if (version && version.length > 0) {
const major = version.split('.')[0];
docVer = `/ver/${major}.x`;
}

return {
getStarted: withUTM(`https://goteleport.com/docs${docVer}/getting-started`),
tshGuide: withUTM(
`https://goteleport.com/docs${docVer}/server-access/guides/tsh`
),
adminGuide: withUTM(
`https://goteleport.com/docs${docVer}/management/admin/`
),
faq: withUTM(`https://goteleport.com/docs${docVer}/faq`),
getStarted: withUTM(`https://goteleport.com/docs/get-started/`),
tshGuide: withUTM(`https://goteleport.com/docs/connect-your-client/tsh/`),
adminGuide: withUTM(`https://goteleport.com/docs/management/admin/`),
faq: withUTM(`https://goteleport.com/docs/faq`),
troubleshooting: withUTM(
`https://goteleport.com/docs${docVer}/management/admin/troubleshooting/`
`https://goteleport.com/docs/management/admin/troubleshooting/`
),

// there isn't a version-specific changelog page
Expand Down

0 comments on commit 2d39f31

Please sign in to comment.