mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 02:08:55 +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(
|
const pastVersions = versions.filter(
|
||||||
(version) => version !== latestVersion && version.name !== 'current',
|
(version) => version !== latestVersion && version.name !== 'current',
|
||||||
);
|
);
|
||||||
|
const stableVersion = pastVersions.shift();
|
||||||
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;
|
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout
|
<Layout
|
||||||
title="Versions"
|
title="Versions"
|
||||||
|
@ -29,18 +30,22 @@ function Version() {
|
||||||
description="Docusaurus 2 Versions page listing all documented site versions">
|
description="Docusaurus 2 Versions page listing all documented site versions">
|
||||||
<main className="container margin-vert--lg">
|
<main className="container margin-vert--lg">
|
||||||
<h1>Docusaurus documentation versions</h1>
|
<h1>Docusaurus documentation versions</h1>
|
||||||
|
|
||||||
|
{stableVersion && (
|
||||||
<div className="margin-bottom--lg">
|
<div className="margin-bottom--lg">
|
||||||
<h3 id="latest">Latest version (Stable)</h3>
|
<h3 id="next">Current version (Stable)</h3>
|
||||||
<p>Here you can find the latest documentation.</p>
|
<p>
|
||||||
|
Here you can find the documentation for current released version.
|
||||||
|
</p>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{latestVersion.label}</th>
|
<th>{stableVersion.name}</th>
|
||||||
<td>
|
<td>
|
||||||
<Link to={latestVersion.path}>Documentation</Link>
|
<Link to={stableVersion.path}>Documentation</Link>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href={`${repoUrl}/releases/tag/v${latestVersion.name}`}>
|
<a href={`${repoUrl}/releases/tag/v${stableVersion.name}`}>
|
||||||
Release Notes
|
Release Notes
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -48,6 +53,26 @@ function Version() {
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</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 && (
|
{currentVersion !== latestVersion && (
|
||||||
<div className="margin-bottom--lg">
|
<div className="margin-bottom--lg">
|
||||||
<h3 id="next">Next version (Unreleased)</h3>
|
<h3 id="next">Next version (Unreleased)</h3>
|
||||||
|
@ -69,7 +94,7 @@ function Version() {
|
||||||
)}
|
)}
|
||||||
{pastVersions.length > 0 && (
|
{pastVersions.length > 0 && (
|
||||||
<div className="margin-bottom--lg">
|
<div className="margin-bottom--lg">
|
||||||
<h3 id="archive">Past Versions</h3>
|
<h3 id="archive">Past versions (Not maintained anymore)</h3>
|
||||||
<p>
|
<p>
|
||||||
Here you can find documentation for previous versions of
|
Here you can find documentation for previous versions of
|
||||||
Docusaurus.
|
Docusaurus.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue