mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-20 10:08:17 +02:00
fix release notes link
This commit is contained in:
parent
2adbc0d6a0
commit
fe1c29bc47
1 changed files with 10 additions and 2 deletions
|
@ -12,6 +12,7 @@ import Translate from '@docusaurus/Translate';
|
||||||
import {
|
import {
|
||||||
useVersions,
|
useVersions,
|
||||||
useLatestVersion,
|
useLatestVersion,
|
||||||
|
type GlobalVersion,
|
||||||
} from '@docusaurus/plugin-content-docs/client';
|
} from '@docusaurus/plugin-content-docs/client';
|
||||||
import Layout from '@theme/Layout';
|
import Layout from '@theme/Layout';
|
||||||
import Heading from '@theme/Heading';
|
import Heading from '@theme/Heading';
|
||||||
|
@ -49,6 +50,13 @@ export default function Version(): ReactNode {
|
||||||
);
|
);
|
||||||
const repoUrl = `https://github.com/${organizationName!}/${projectName!}`;
|
const repoUrl = `https://github.com/${organizationName!}/${projectName!}`;
|
||||||
|
|
||||||
|
function getReleaseNotesUrl(version: GlobalVersion): string {
|
||||||
|
if (version.name === '2.x') {
|
||||||
|
return 'https://github.com/facebook/docusaurus/blob/main/CHANGELOG-v2.md';
|
||||||
|
}
|
||||||
|
return `${repoUrl}/releases/tag/v${version.name}`;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
title="Versions"
|
title="Versions"
|
||||||
|
@ -81,7 +89,7 @@ export default function Version(): ReactNode {
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Link to={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
|
<Link to={getReleaseNotesUrl(latestVersion)}>
|
||||||
<ReleaseNotesLabel />
|
<ReleaseNotesLabel />
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</td>
|
||||||
|
@ -142,7 +150,7 @@ export default function Version(): ReactNode {
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<Link href={`${repoUrl}/releases/tag/v${version.name}`}>
|
<Link href={getReleaseNotesUrl(version)}>
|
||||||
<ReleaseNotesLabel />
|
<ReleaseNotesLabel />
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue