/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import React from 'react'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Link from '@docusaurus/Link'; import Translate from '@docusaurus/Translate'; import { useVersions, useLatestVersion, } from '@docusaurus/plugin-content-docs/client'; import Layout from '@theme/Layout'; import Heading from '@theme/Heading'; import VersionsArchived from '@site/versionsArchived.json'; const docsPluginId = undefined; // Default docs plugin instance const VersionsArchivedList = Object.entries(VersionsArchived); function DocumentationLabel() { return ( Documentation ); } function ReleaseNotesLabel() { return ( Release Notes ); } export default function Version(): JSX.Element { 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/${organizationName!}/${projectName!}`; return (
Docusaurus documentation versions
Current version (Stable)

Here you can find the documentation for current released version.

{latestVersion.label}
{currentVersion !== latestVersion && (
Next version (Unreleased)

Here you can find the documentation for work-in-process unreleased version.

{currentVersion.label}
)} {(pastVersions.length > 0 || VersionsArchivedList.length > 0) && (
Past versions (Not maintained anymore)

Here you can find documentation for previous versions of Docusaurus.

{pastVersions.map((version) => ( ))} {VersionsArchivedList.map(([versionName, versionUrl]) => ( ))}
{version.label}
{versionName}
)}

Docusaurus v1 (Legacy)

Here you can find documentation for legacy version of Docusaurus.

1.x
); }