parent
ac0a40beda
commit
ea16bf0046
File diff suppressed because it is too large
Load Diff
@ -1,104 +1,104 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
import Layout from '@theme/Layout';
|
import Layout from '@theme/Layout';
|
||||||
|
|
||||||
import {useVersions, useLatestVersion} from '@theme/hooks/useDocs';
|
import {useLatestVersion, useVersions} from '@docusaurus/plugin-content-docs/client';
|
||||||
|
|
||||||
function Version(): JSX.Element {
|
function Version(): JSX.Element {
|
||||||
const {
|
const {
|
||||||
siteConfig: {organizationName, projectName},
|
siteConfig: {organizationName, projectName},
|
||||||
} = useDocusaurusContext();
|
} = useDocusaurusContext();
|
||||||
const versions = useVersions();
|
const versions = useVersions();
|
||||||
const latestVersion = useLatestVersion();
|
const latestVersion = useLatestVersion();
|
||||||
const currentVersion = versions.find(
|
const currentVersion = versions.find(
|
||||||
(version) => version.name === 'current',
|
(version) => version.name === 'current',
|
||||||
)!;
|
)!;
|
||||||
const pastVersions = versions.filter(
|
const pastVersions = versions.filter(
|
||||||
(version) => version !== latestVersion && version.name !== 'current',
|
(version) => version !== latestVersion && version.name !== 'current',
|
||||||
);
|
);
|
||||||
const repoUrl = `https://github.com/${organizationName}/${projectName}`;
|
const repoUrl = `https://github.com/${organizationName}/${projectName}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
title="Versions"
|
title="Versions"
|
||||||
description="Docusaurus 2 Versions page listing all documented site versions">
|
description="Docusaurus 2 Versions page listing all documented site versions">
|
||||||
<main className="container margin-vert--lg">
|
<main className="container margin-vert--lg">
|
||||||
<h1>Halo documentation versions</h1>
|
<h1>Halo documentation versions</h1>
|
||||||
|
|
||||||
{latestVersion && (
|
{latestVersion && (
|
||||||
<div className="margin-bottom--lg">
|
<div className="margin-bottom--lg">
|
||||||
<h3 id="next">Current version (Stable)</h3>
|
<h3 id="next">Current version (Stable)</h3>
|
||||||
<p>
|
<p>
|
||||||
Here you can find the documentation for current released version.
|
Here you can find the documentation for current released version.
|
||||||
</p>
|
</p>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{latestVersion.label}</th>
|
<th>{latestVersion.label}</th>
|
||||||
<td>
|
<td>
|
||||||
<Link to={latestVersion.path}>Documentation</Link>
|
<Link to={latestVersion.path}>Documentation</Link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
|
<a href={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
|
||||||
Release Notes
|
Release Notes
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{currentVersion !== latestVersion && (
|
{currentVersion !== latestVersion && (
|
||||||
<div className="margin-bottom--lg">
|
<div className="margin-bottom--lg">
|
||||||
<h3 id="latest">Next version (Unreleased)</h3>
|
<h3 id="latest">Next version (Unreleased)</h3>
|
||||||
<p>
|
<p>
|
||||||
Here you can find the documentation for work-in-process unreleased
|
Here you can find the documentation for work-in-process unreleased
|
||||||
version.
|
version.
|
||||||
</p>
|
</p>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{currentVersion.label}</th>
|
<th>{currentVersion.label}</th>
|
||||||
<td>
|
<td>
|
||||||
<Link to={currentVersion.path}>Documentation</Link>
|
<Link to={currentVersion.path}>Documentation</Link>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{(pastVersions.length > 0) && (
|
{(pastVersions.length > 0) && (
|
||||||
<div className="margin-bottom--lg">
|
<div className="margin-bottom--lg">
|
||||||
<h3 id="archive">Past versions (Not maintained anymore)</h3>
|
<h3 id="archive">Past versions (Not maintained anymore)</h3>
|
||||||
<p>
|
<p>
|
||||||
Here you can find documentation for previous versions of
|
Here you can find documentation for previous versions of
|
||||||
Docusaurus.
|
Docusaurus.
|
||||||
</p>
|
</p>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
{pastVersions.map((version) => (
|
{pastVersions.map((version) => (
|
||||||
<tr key={version.name}>
|
<tr key={version.name}>
|
||||||
<th>{version.label}</th>
|
<th>{version.label}</th>
|
||||||
<td>
|
<td>
|
||||||
<Link to={version.path}>Documentation</Link>
|
<Link to={version.path}>Documentation</Link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href={`${repoUrl}/releases/tag/v${version.name}`}>
|
<a href={`${repoUrl}/releases/tag/v${version.name}`}>
|
||||||
Release Notes
|
Release Notes
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</main>
|
</main>
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Version;
|
export default Version;
|
Loading…
Reference in new issue