Skip to content

Commit

Permalink
[v14] Remove /ver/ segments from Web UI docs links (#45506)
Browse files Browse the repository at this point in the history
* Remove `/ver/` segments from Web UI docs links

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.

* Update snapshots
  • Loading branch information
ptgott authored Sep 9, 2024
1 parent 7b4743a commit 8282603
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 40 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
Original file line number Diff line number Diff line change
Expand Up @@ -229,23 +229,23 @@ exports[`support Cloud 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/getting-started?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/get-started/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Get Started
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/server-access/guides/tsh?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/connect-your-client/tsh/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
tsh User Guide
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand All @@ -260,7 +260,7 @@ exports[`support Cloud 1`] = `
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/faq?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/faq?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -296,7 +296,7 @@ exports[`support Cloud 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/troubleshooting/?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/troubleshooting/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -655,23 +655,23 @@ exports[`support Enterprise 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/getting-started?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/get-started/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Get Started
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/server-access/guides/tsh?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/connect-your-client/tsh/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
tsh User Guide
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand All @@ -687,7 +687,7 @@ exports[`support Enterprise 1`] = `
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/faq?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/faq?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -723,7 +723,7 @@ exports[`support Enterprise 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/troubleshooting/?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/troubleshooting/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -1163,23 +1163,23 @@ exports[`support Enterprise with CTA 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/getting-started?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/get-started/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Get Started
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/server-access/guides/tsh?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/connect-your-client/tsh/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
tsh User Guide
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand All @@ -1195,7 +1195,7 @@ exports[`support Enterprise with CTA 1`] = `
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/faq?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/faq?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -1231,7 +1231,7 @@ exports[`support Enterprise with CTA 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/troubleshooting/?product=teleport&version=e_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/troubleshooting/?product=teleport&version=e_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -1582,23 +1582,23 @@ exports[`support OSS 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/getting-started?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/get-started/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Get Started
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/server-access/guides/tsh?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/connect-your-client/tsh/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
tsh User Guide
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand All @@ -1614,7 +1614,7 @@ exports[`support OSS 1`] = `
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/faq?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/faq?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -1650,7 +1650,7 @@ exports[`support OSS 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/troubleshooting/?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/troubleshooting/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -2090,23 +2090,23 @@ exports[`support OSSWithCTA 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/getting-started?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/get-started/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Get Started
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/server-access/guides/tsh?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/connect-your-client/tsh/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
tsh User Guide
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand All @@ -2122,7 +2122,7 @@ exports[`support OSSWithCTA 1`] = `
</a>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/faq?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/faq?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down Expand Up @@ -2158,7 +2158,7 @@ exports[`support OSSWithCTA 1`] = `
</div>
<a
class="c7"
href="https://goteleport.com/docs/ver/13.x/management/admin/troubleshooting/?product=teleport&version=oss_13.4.0-dev"
href="https://goteleport.com/docs/management/admin/troubleshooting/?product=teleport&version=oss_13.4.0-dev"
rel="noreferrer"
target="_blank"
>
Expand Down

0 comments on commit 8282603

Please sign in to comment.