-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from go-vela/fix/version-numbers
fix: use accurate version numbers
- Loading branch information
Showing
69 changed files
with
133 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
import React, { ReactNode } from 'react'; | ||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; | ||
import Link from '@docusaurus/Link'; | ||
import { | ||
useVersions, | ||
useLatestVersion, | ||
} from '@docusaurus/plugin-content-docs/client'; | ||
import Layout from '@theme/Layout'; | ||
import Heading from '@theme/Heading'; | ||
|
||
const docsPluginId = undefined; | ||
|
||
const VersionsArchived = { | ||
"0.25": "/usage/quickstart", | ||
"0.24": "/0.24.x/usage/quickstart", | ||
}; | ||
|
||
const VersionsArchivedList = Object.entries(VersionsArchived); | ||
|
||
function DocumentationLabel() { | ||
return ( | ||
<span>Documentation</span> | ||
); | ||
} | ||
|
||
function ReleaseNotesLabel() { | ||
return ( | ||
<span> | ||
Release Notes | ||
</span> | ||
); | ||
} | ||
|
||
export default function Version(): ReactNode { | ||
const { | ||
siteConfig: { organizationName, projectName }, | ||
} = useDocusaurusContext(); | ||
const versions = useVersions(docsPluginId); | ||
const latestVersion = useLatestVersion(docsPluginId); | ||
const currentVersion = versions.find( | ||
(version) => version.name === 'current', | ||
)!; | ||
const pastVersions = versions.filter( | ||
(version) => version !== latestVersion && version.name !== 'current', | ||
); | ||
const repoUrl = `https://github.com/go-vela/community`; | ||
|
||
return ( | ||
<Layout | ||
title="Versions" | ||
description="Vela Versions page listing all versions"> | ||
<main className="container margin-vert--lg"> | ||
<h1> | ||
<span> | ||
Vela versions | ||
</span> | ||
</h1> | ||
|
||
<div className="margin-bottom--lg"> | ||
<Heading as="h3" id="next"> | ||
<span> | ||
Current version | ||
</span> | ||
</Heading> | ||
<p> | ||
<span> | ||
Here you can find the documentation for the latest release. | ||
</span> | ||
</p> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>{latestVersion.label}</th> | ||
<td> | ||
<Link to={latestVersion.path}> | ||
<DocumentationLabel /> | ||
</Link> | ||
</td> | ||
<td> | ||
<Link to={`${repoUrl}/blob/main/releases/v${latestVersion.name}.md`}> | ||
<ReleaseNotesLabel /> | ||
</Link> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
{(pastVersions.length > 0 || VersionsArchivedList.length > 0) && ( | ||
<div className="margin-bottom--lg"> | ||
<Heading as="h3" id="archive"> | ||
<span> | ||
Previous versions (Not maintained anymore) | ||
</span> | ||
</Heading> | ||
<p> | ||
<span> | ||
Here you can find documentation for past releases. | ||
</span> | ||
</p> | ||
<table> | ||
<tbody> | ||
{VersionsArchivedList.map(([versionName, versionUrl]) => ( | ||
latestVersion.label !== versionName ? | ||
<tr key={versionName}> | ||
<th>{versionName}</th> | ||
<td> | ||
<Link to={versionUrl}> | ||
<DocumentationLabel /> | ||
</Link> | ||
</td> | ||
<td> | ||
<Link href={`${repoUrl}/blob/main/releases/v${versionName}.md`}> | ||
<ReleaseNotesLabel /> | ||
</Link> | ||
</td> | ||
</tr> : <></> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
)} | ||
</main> | ||
</Layout> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[ | ||
"1.1", | ||
"1.0" | ||
"0.25", | ||
"0.24" | ||
] |