This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
forked from prevwong/craft.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
517 additions
and
23 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
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,95 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from "react"; | ||
import styled from "styled-components"; | ||
|
||
import Layout from "@theme/Layout"; | ||
|
||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; | ||
import Link from "@docusaurus/Link"; | ||
import useBaseUrl from "@docusaurus/useBaseUrl"; | ||
|
||
import versions from "../../versions.json"; | ||
|
||
const Page = styled.div` | ||
padding: 40px 0; | ||
> h1 { | ||
font-weight: 500; | ||
margin-bottom: 30px; | ||
} | ||
> div > h3 { | ||
font-size: 15px; | ||
} | ||
`; | ||
|
||
function Version() { | ||
const context = useDocusaurusContext(); | ||
const { siteConfig = {} } = context; | ||
const latestVersion = versions[0]; | ||
const pastVersions = versions.filter((version) => version !== latestVersion); | ||
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`; | ||
|
||
return ( | ||
<Layout | ||
title="Versions" | ||
permalink="/versions" | ||
description="Docusaurus 2 Versions page listing all documented site versions" | ||
> | ||
<Page className="container margin-vert--lg"> | ||
<h1>Craft.js Documentation Versions</h1> | ||
<div className="margin-bottom--lg"> | ||
<h3 id="latest">Latest version (Stable)</h3> | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>{latestVersion}</th> | ||
<td> | ||
<Link to={useBaseUrl("/docs/introduction")}> | ||
Documentation | ||
</Link> | ||
</td> | ||
<td> | ||
<a href={`${repoUrl}/releases/tag/v${latestVersion}`}> | ||
Release Notes | ||
</a> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
{pastVersions.length > 0 && ( | ||
<div className="margin-bottom--lg"> | ||
<h3 id="archive">Past Versions</h3> | ||
<table> | ||
<tbody> | ||
{pastVersions.map((version) => ( | ||
<tr key={version}> | ||
<th>{version}</th> | ||
<td> | ||
<Link to={useBaseUrl(`/docs/${version}/introduction`)}> | ||
Documentation | ||
</Link> | ||
</td> | ||
<td> | ||
<a href={`${repoUrl}/releases/tag/v${version}`}> | ||
Release Notes | ||
</a> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
)} | ||
</Page> | ||
</Layout> | ||
); | ||
} | ||
|
||
export default Version; |
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
Oops, something went wrong.