Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use scripts from coursier to handle website (#306)
Referencing https://github.com/coursier/docusaurus-mdoc-scripts as a submodule in particular
- Loading branch information
1 parent
7e65de1
commit 2ff4799
Showing
10 changed files
with
221 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "scripts/website"] | ||
path = scripts/website | ||
url = https://github.com/coursier/docusaurus-mdoc-scripts.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/** | ||
* 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(process.cwd() + '/siteConfig.js'); | ||
try { | ||
var versions = require(`${CWD}/versions.json`); | ||
} catch (e) { | ||
var versions = []; | ||
} | ||
|
||
function Versions() { | ||
const latestVersion = versions[0] || ''; | ||
const language = ''; | ||
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> | ||
<h3 id="latest">Current version</h3> | ||
<table className="versions"> | ||
<tbody> | ||
<tr> | ||
<th>{latestVersion}</th> | ||
<td> | ||
<a | ||
href={`${siteConfig.baseUrl}docs/intro`}> | ||
Documentation | ||
</a> | ||
</td> | ||
<td> | ||
<a href={`${repoUrl}/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/next/intro`}> | ||
Documentation | ||
</a> | ||
</td> | ||
<td> | ||
<a href={repoUrl}>Source Code</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<h3 id="archive">Past Versions</h3> | ||
<p> | ||
Here you can find documentation for previous versions. | ||
</p> | ||
<table className="versions"> | ||
<tbody> | ||
{versions.map( | ||
version => | ||
version !== latestVersion && ( | ||
<tr key={version}> | ||
<th>{version}</th> | ||
<td> | ||
<a | ||
href={`${siteConfig.baseUrl}docs/${version}/intro`}> | ||
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}/releases`}>GitHub</a>. | ||
</p> | ||
</div> | ||
</Container> | ||
</div> | ||
); | ||
} | ||
|
||
Versions.title = 'Versions'; | ||
|
||
module.exports = Versions; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.