Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2): fix website versions page #4234

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 23 additions & 22 deletions website/src/pages/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function Version() {
const pastVersions = versions.filter(
(version) => version !== latestVersion && version.name !== 'current',
);
const stableVersion = pastVersions.shift();
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;

return (
Expand All @@ -30,7 +29,7 @@ function Version() {
<main className="container margin-vert--lg">
<h1>Docusaurus documentation versions</h1>

{stableVersion && (
{latestVersion && (
<div className="margin-bottom--lg">
<h3 id="next">Current version (Stable)</h3>
<p>
Expand All @@ -39,12 +38,12 @@ function Version() {
<table>
<tbody>
<tr>
<th>{stableVersion.name}</th>
<th>{latestVersion.label}</th>
<td>
<Link to={stableVersion.path}>Documentation</Link>
<Link to={latestVersion.path}>Documentation</Link>
</td>
<td>
<a href={`${repoUrl}/releases/tag/v${stableVersion.name}`}>
<a href={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
Release Notes
</a>
</td>
Expand All @@ -54,23 +53,25 @@ function Version() {
</div>
)}

<div className="margin-bottom--lg">
<h3 id="latest">Next version (Unreleased)</h3>
<p>
Here you can find the documentation for work-in-process unreleased
version.
</p>
<table>
<tbody>
<tr>
<th>{latestVersion.label}</th>
<td>
<Link to={latestVersion.path}>Documentation</Link>
</td>
</tr>
</tbody>
</table>
</div>
{currentVersion !== latestVersion && (
<div className="margin-bottom--lg">
<h3 id="latest">Next version (Unreleased)</h3>
<p>
Here you can find the documentation for work-in-process unreleased
version.
</p>
<table>
<tbody>
<tr>
<th>{currentVersion.label}</th>
<td>
<Link to={currentVersion.path}>Documentation</Link>
</td>
</tr>
</tbody>
</table>
</div>
)}

{pastVersions.length > 0 && (
<div className="margin-bottom--lg">
Expand Down