Skip to content

Commit

Permalink
refactor(v2): clarify versions page (#3577)
Browse files Browse the repository at this point in the history
* refactor(v2): clarify versions page

* Make Netlify happy
  • Loading branch information
lex111 authored Oct 12, 2020
1 parent 4130f1a commit e5d9cdc
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions website/src/pages/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,59 @@ 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 (
<Layout
title="Versions"
permalink="/versions"
description="Docusaurus 2 Versions page listing all documented site versions">
<main className="container margin-vert--lg">
<h1>Docusaurus documentation versions</h1>

{stableVersion && (
<div className="margin-bottom--lg">
<h3 id="next">Current version (Stable)</h3>
<p>
Here you can find the documentation for current released version.
</p>
<table>
<tbody>
<tr>
<th>{stableVersion.name}</th>
<td>
<Link to={stableVersion.path}>Documentation</Link>
</td>
<td>
<a href={`${repoUrl}/releases/tag/v${stableVersion.name}`}>
Release Notes
</a>
</td>
</tr>
</tbody>
</table>
</div>
)}

<div className="margin-bottom--lg">
<h3 id="latest">Latest version (Stable)</h3>
<p>Here you can find the latest documentation.</p>
<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>
<td>
<a href={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
Release Notes
</a>
</td>
</tr>
</tbody>
</table>
</div>

{currentVersion !== latestVersion && (
<div className="margin-bottom--lg">
<h3 id="next">Next version (Unreleased)</h3>
Expand All @@ -69,7 +94,7 @@ function Version() {
)}
{pastVersions.length > 0 && (
<div className="margin-bottom--lg">
<h3 id="archive">Past Versions</h3>
<h3 id="archive">Past versions (Not maintained anymore)</h3>
<p>
Here you can find documentation for previous versions of
Docusaurus.
Expand Down

0 comments on commit e5d9cdc

Please sign in to comment.