Reduce version redundancy (#4707)

This commit is contained in:
qwerty287 2025-01-11 18:14:47 +02:00 committed by GitHub
parent fbd4332bee
commit 521a2bd3cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,6 +2,27 @@ import * as path from 'path';
import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import { themes } from 'prism-react-renderer';
import * as versions from './versions.json';
const docsVersions = {
current: {
label: 'Next 🚧',
banner: 'unreleased',
},
};
const includeVersions = ['current', versions.default[0]];
versions.default.forEach((v, index) => {
const version = {
label: `${v}.x${index === 0 ? '' : ' 💀'}`,
};
if (index !== 0 && process.env.NODE_ENV !== 'development') {
version['banner'] = 'unmaintained';
includeVersions.push(v);
}
docsVersions[v] = version;
});
const config = {
title: 'Woodpecker CI',
@ -236,30 +257,9 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/woodpecker-ci/woodpecker/edit/main/docs/',
includeCurrentVersion: true,
lastVersion: '2.8',
onlyIncludeVersions:
process.env.NODE_ENV === 'development' ? ['current', '2.8'] : ['current', '2.8', '2.7', '2.6', '1.0'],
versions: {
current: {
label: 'Next 🚧',
banner: 'unreleased',
},
'2.8': {
label: '2.8.x',
},
'2.7': {
label: '2.7.x 💀',
banner: 'unmaintained',
},
'2.6': {
label: '2.6.x 💀',
banner: 'unmaintained',
},
'1.0': {
label: '1.0.x 💀',
banner: 'unmaintained',
},
},
lastVersion: versions.default[0],
onlyIncludeVersions: includeVersions,
versions: docsVersions,
},
blog: {
blogTitle: 'Blog',