Skip to content

Commit

Permalink
fix versions page
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Feb 17, 2021
1 parent cf080c7 commit 254428e
Showing 1 changed file with 23 additions and 22 deletions.
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

0 comments on commit 254428e

Please sign in to comment.