mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 06:50:36 +02:00
refactor(v2): clarify versions page (#3577)
* refactor(v2): clarify versions page * Make Netlify happy
This commit is contained in:
parent
4130f1a195
commit
e5d9cdc871
1 changed files with 34 additions and 9 deletions
|
@ -20,8 +20,9 @@ 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"
|
||||
|
@ -29,9 +30,37 @@ function Version() {
|
|||
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>
|
||||
|
@ -39,15 +68,11 @@ function Version() {
|
|||
<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>
|
||||
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue