Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add archived versions system + archive alpha.73-75 #5005

Merged
merged 1 commit into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const path = require('path');
const versions = require('./versions.json');
const math = require('remark-math');
const katex = require('rehype-katex');
const VersionsArchived = require('./versionsArchived.json');

// This probably only makes sense for the beta phase, temporary
function getNextBetaVersionName() {
Expand Down Expand Up @@ -367,6 +368,12 @@ const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
position: 'right',
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
...Object.entries(VersionsArchived).map(
([versionName, versionUrl]) => ({
label: versionName,
href: versionUrl,
}),
),
{
href: 'https://v1.docusaurus.io',
label: '1.x.x',
Expand Down
19 changes: 18 additions & 1 deletion website/src/pages/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import Layout from '@theme/Layout';

import {useVersions, useLatestVersion} from '@theme/hooks/useDocs';

import VersionsArchived from '@site/versionsArchived.json';

const VersionsArchivedList = Object.entries(VersionsArchived);

function Version() {
const {siteConfig} = useDocusaurusContext();
const versions = useVersions();
Expand Down Expand Up @@ -73,7 +77,7 @@ function Version() {
</div>
)}

{pastVersions.length > 0 && (
{(pastVersions.length > 0 || VersionsArchived.length > 0) && (
<div className="margin-bottom--lg">
<h3 id="archive">Past versions (Not maintained anymore)</h3>
<p>
Expand All @@ -95,6 +99,19 @@ function Version() {
</td>
</tr>
))}
{VersionsArchivedList.map(([versionName, versionUrl]) => (
<tr key={versionName}>
<th>{versionName}</th>
<td>
<Link to={versionUrl}>Documentation</Link>
</td>
<td>
<a href={`${repoUrl}/releases/tag/v${versionName}`}>
Release Notes
</a>
</td>
</tr>
))}
</tbody>
</table>
</div>
Expand Down
Loading