mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 08:19:07 +02:00
Add versioning to docusaurus.io (#552)
This commit is contained in:
parent
257b5c9ebd
commit
3486e1113f
17 changed files with 1887 additions and 0 deletions
105
website/pages/en/versions.js
Normal file
105
website/pages/en/versions.js
Normal file
|
@ -0,0 +1,105 @@
|
|||
/**
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
|
||||
const CompLibrary = require('../../core/CompLibrary');
|
||||
const Container = CompLibrary.Container;
|
||||
const GridBlock = CompLibrary.GridBlock;
|
||||
|
||||
const CWD = process.cwd();
|
||||
|
||||
const siteConfig = require(CWD + '/siteConfig.js');
|
||||
const versions = require(CWD + '/versions.json');
|
||||
|
||||
class Versions extends React.Component {
|
||||
render() {
|
||||
const latestVersion = versions[0];
|
||||
return (
|
||||
<div className="docMainWrapper wrapper">
|
||||
<Container className="mainContainer versionsContainer">
|
||||
<div className="post">
|
||||
<header className="postHeader">
|
||||
<h2>{siteConfig.title + ' Versions'}</h2>
|
||||
</header>
|
||||
<h3 id="latest">Current version (Stable)</h3>
|
||||
<p>Latest version of Docusaurus.</p>
|
||||
<table className="versions">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>{latestVersion}</th>
|
||||
<td>
|
||||
<a href={`${siteConfig.baseUrl}docs/en/installation.html`}>Documentation</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href={`https://github.com/facebook/Docusaurus/releases/tag/v${latestVersion}`}>Release Notes</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="rc">Latest Version</h3>
|
||||
Here you can find the latest documentation and unreleased code.
|
||||
<table className="versions">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>master</th>
|
||||
<td>
|
||||
<a
|
||||
href={`${
|
||||
siteConfig.baseUrl
|
||||
}docs/en/next/installation.html`}
|
||||
>
|
||||
Documentation
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href={'https://github.com/facebook/docusaurus'}>Source Code</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="archive">Past Versions</h3>
|
||||
<p>Here you can find documentation for previous versions of Docusaurus.</p>
|
||||
<table className="versions">
|
||||
<tbody>
|
||||
{versions.map(
|
||||
version =>
|
||||
version !== latestVersion && (
|
||||
<tr>
|
||||
<th>{version}</th>
|
||||
<td>
|
||||
<a
|
||||
href={`${
|
||||
siteConfig.baseUrl
|
||||
}docs/en/${version}/installation.html`}
|
||||
>
|
||||
Documentation
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a
|
||||
href={`https://github.com/facebook/relay/releases/tag/v${version}`}>
|
||||
Release Notes
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<p>
|
||||
You can find past versions of this project{' '}
|
||||
<a href="https://github.com/"> on GitHub </a>.
|
||||
</p>
|
||||
</div>
|
||||
</Container>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Versions;
|
Loading…
Add table
Add a link
Reference in a new issue