| /** |
| * 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 CWD = process.cwd(); |
| |
| const siteConfig = require(`${CWD}/siteConfig.js`); |
| // versions |
| const versions = require(`${CWD}/versions.json`); |
| |
| function Versions(props) { |
| // const {config: siteConfig} = props; |
| const latestStableVersion = versions[0]; |
| |
| const repoUrl = `https://github.com/${siteConfig.organizationName}/${ |
| siteConfig.projectName |
| }`; |
| return ( |
| <div className="docMainWrapper wrapper"> |
| <Container className="mainContainer versionsContainer"> |
| <div className="post"> |
| <header className="postHeader"> |
| <h1>{siteConfig.title} Versions</h1> |
| </header> |
| <p>New versions of this project are released every so often.</p> |
| <h3 id="latest">Current version (Stable)</h3> |
| <table className="versions"> |
| <tbody> |
| <tr> |
| <th>{latestStableVersion}</th> |
| <td> |
| {/* You are supposed to change this href where appropriate |
| Example: href="<baseUrl>/docs(/:language)/:id" */} |
| {/* <a |
| href={`${siteConfig.baseUrl}${siteConfig.docsUrl}/${ |
| props.language ? props.language + '/' : '' |
| }doc1`}> */} |
| <a |
| href={`${siteConfig.baseUrl}docs/${props.language}/getting-started-local-single-node`}> |
| Documentation |
| </a> |
| </td> |
| <td> |
| <a href="">Release Notes</a> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <p> |
| This is the version that is configured automatically when you first |
| install this project. |
| </p> |
| <h3 id="rc">Pre-release versions</h3> |
| <table className="versions"> |
| <tbody> |
| <tr> |
| <th>master</th> |
| <td> |
| {/* You are supposed to change this href where appropriate |
| Example: href="<baseUrl>/docs(/:language)/next/:id" */} |
| <a |
| href={`${siteConfig.baseUrl}docs/${props.language}/next/getting-started-local-single-node`}> |
| Documentation |
| </a> |
| </td> |
| <td> |
| <a href={repoUrl}>Source Code</a> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <p>Other text describing this section.</p> |
| <h3 id="archive">Past Versions</h3> |
| <p>Here you can find previous versions of the documentation.</p> |
| <table className="versions"> |
| <tbody> |
| {versions.map( |
| |
| |
| version => |
| version !== latestStableVersion && ( |
| <tr> |
| <th>{version}</th> |
| <td> |
| {/* You are supposed to change this href where appropriate |
| Example: href="<baseUrl>/docs(/:language)/:version/:id" */} |
| <a |
| href={`${siteConfig.baseUrl}docs/${props.language}/${version}/getting-started-local-single-node`}> |
| Documentation |
| </a> |
| </td> |
| <td> |
| <a href={`${repoUrl}/releases/tag/v${version}`}> |
| Release Notes |
| </a> |
| </td> |
| </tr> |
| ), |
| )} |
| </tbody> |
| </table> |
| <p> |
| You can find past versions of this project on{' '} |
| <a href={repoUrl}>GitHub</a>. |
| </p> |
| </div> |
| </Container> |
| </div> |
| ); |
| } |
| |
| Versions.title = 'Versions'; |
| |
| module.exports = Versions; |