Fix version page

This commit is contained in:
Paulus Schoutsen 2018-06-29 11:46:58 -04:00
parent 1676219f78
commit 7262f8c1e9

View File

@ -16,6 +16,8 @@ const CWD = process.cwd();
const siteConfig = require(CWD + '/siteConfig.js'); const siteConfig = require(CWD + '/siteConfig.js');
const versions = require(CWD + '/versions.json'); const versions = require(CWD + '/versions.json');
const versionUrl = (language, version) => `${siteConfig.baseUrl}docs/${language}/${version}/architecture_index.html`
class Versions extends React.Component { class Versions extends React.Component {
render() { render() {
const latestVersion = versions[0]; const latestVersion = versions[0];
@ -26,40 +28,40 @@ class Versions extends React.Component {
<header className="postHeader"> <header className="postHeader">
<h2>{siteConfig.title + ' Versions'}</h2> <h2>{siteConfig.title + ' Versions'}</h2>
</header> </header>
<p>New versions of this project are released every so often.</p> <p>New versions of this project are released every 2 weeks.</p>
<h3 id="latest">Current version (Stable)</h3> <h3 id="latest">Current version (Stable)</h3>
<table className="versions"> <table className="versions">
<tbody> <tbody>
<tr> <tr>
<th>{latestVersion}</th> <th>{latestVersion}</th>
<td> <td>
<a href={''}>Documentation</a> <a href={`${siteConfig.baseUrl}${this.props.language}/`}>Documentation</a>
</td> </td>
<td> <td>
<a href={''}>Release Notes</a> <a href={`https://www.home-assistant.io/latest-release-notes/`}>Release Notes</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p> {/* <p>
This is the version that is configured automatically when you This is the version that is configured automatically when you
first install this project. first install this project.
</p> </p> */}
<h3 id="rc">Pre-release versions</h3> <h3 id="rc">Pre-release versions</h3>
<table className="versions"> <table className="versions">
<tbody> <tbody>
<tr> <tr>
<th>master</th> <th>next</th>
<td> <td>
<a href={''}>Documentation</a> <a href={versionUrl(this.props.language, 'next')}>Documentation</a>
</td> </td>
<td> <td>
<a href={''}>Release Notes</a> <a href={'https://rc.home-assistant.io'}>Release Notes</a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<p>Other text describing this section.</p> {/* <p>Other text describing this section.</p> */}
<h3 id="archive">Past Versions</h3> <h3 id="archive">Past Versions</h3>
<table className="versions"> <table className="versions">
<tbody> <tbody>
@ -71,18 +73,18 @@ class Versions extends React.Component {
<td> <td>
<a href={''}>Documentation</a> <a href={''}>Documentation</a>
</td> </td>
<td> {/* <td>
<a href={''}>Release Notes</a> <a href={''}>Release Notes</a>
</td> </td> */}
</tr> </tr>
) )
)} )}
</tbody> </tbody>
</table> </table>
<p> {/* <p>
You can find past versions of this project{' '} You can find past versions of this project{' '}
<a href="https://github.com/"> on GitHub </a>. <a href="https://github.com/"> on GitHub </a>.
</p> </p> */}
</div> </div>
</Container> </Container>
</div> </div>