Skip to content

Commit

Permalink
Provisionally update the docs for v17 (#504)
Browse files Browse the repository at this point in the history
The docs versioning policy for v17 onward is to switch the default docs
version to the newly released major version when we roll it out to Cloud
customers. However, this means that once we release the new major
version, users who visit the tab for that version see a message that the
version is an upcoming release.

This change edits the docs engine to not display the "upcoming release"
message for v17, while keeping v16 as the default docs version. It also
adds an "Edge" submodule for `master`. Since we no longer support v14,
this change removes the v14 submodule.
  • Loading branch information
ptgott authored Nov 16, 2024
1 parent b44a984 commit accf264
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "content/14.x"]
path = content/14.x
url = https://github.com/gravitational/teleport
branch = branch/v14
[submodule "content/15.x"]
path = content/15.x
url = https://github.com/gravitational/teleport
Expand All @@ -13,4 +9,8 @@
[submodule "content/17.x"]
path = content/17.x
url = https://github.com/gravitational/teleport
branch = master
branch = branch/v17

[submodule "content/edge"]
path = content/edge
url = https://github.com/gravitational/teleport
7 changes: 6 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
},
{
"name": "14.x",
"branch": "branch/v14"
"branch": "branch/v14",
"deprecated": true
},
{
"name": "15.x",
Expand All @@ -75,6 +76,10 @@
},
{
"name": "17.x",
"branch": "branch/v17"
},
{
"name": "edge",
"branch": "master"
}
]
Expand Down
1 change: 0 additions & 1 deletion content/14.x
Submodule 14.x deleted from 473214
2 changes: 1 addition & 1 deletion content/15.x
Submodule 15.x updated 8558 files
2 changes: 1 addition & 1 deletion content/16.x
Submodule 16.x updated 6940 files
2 changes: 1 addition & 1 deletion content/17.x
Submodule 17.x updated 5593 files
1 change: 1 addition & 0 deletions content/edge
Submodule edge added at f3e36e
10 changes: 1 addition & 9 deletions layouts/DocsPage/DocsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const DocsPage = ({
const icon = navigation[categoryId]?.icon || "book";

const isOldVersion = available.indexOf(current) < available.indexOf(latest);
const isBetaVersion = available.indexOf(current) > available.indexOf(latest);

let path = getPath(latest);

Expand Down Expand Up @@ -104,7 +103,7 @@ const DocsPage = ({
)}
<div className={cn(styles["main-wrapper"], styles[layout])}>
<div className={styles.main}>
{(isOldVersion || isBetaVersion) && (
{isOldVersion && (
<Notice type="danger" className={styles.notice}>
{isOldVersion && (
<>
Expand All @@ -113,13 +112,6 @@ const DocsPage = ({
version instead.
</>
)}
{isBetaVersion && (
<>
This chapter covers an upcoming release: {current}. We
recommend the <Link href={`${urlCurrent}`}>latest</Link>{" "}
version instead.
</>
)}
</Notice>
)}
<VarsProvider>
Expand Down
7 changes: 7 additions & 0 deletions layouts/DocsPage/Versions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import styles from "./Versions.module.css";

// renders strikethrough for deprecated versions
const renderVersion = (version: VersionsDropdown) => {
if (version.value === "edge") {
return "Edge version";
}
if (version.deprecated) return <s>Version {version.value}</s>;

if (version.value === "Older Versions") return version.value;
Expand All @@ -25,6 +28,10 @@ const validVersion = (thisVersion: string, latestVersion: string) => {
const currentMajorVersion = majorVersionRe.exec(thisVersion);
const latestMajorVersion = majorVersionRe.exec(latestVersion);

if (thisVersion === "edge") {
return true;
}

// Can't calculate validity, so the version is invalid. This happens, e.g.,
// if we're dealing with a dropdown option like "Older Versions".
if (currentMajorVersion == null || latestMajorVersion == null) {
Expand Down

0 comments on commit accf264

Please sign in to comment.