mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 08:57:03 +02:00
chore(v2): v2 website should make it easy to contribute to upstream docs (#3506)
* To incitate to contribute to upstream docs, we could set the upstream docs the main docs so that editUrl will modify upstream docs in priority * add unreleased label instead of next
This commit is contained in:
parent
35b6edb3f3
commit
85ff9bd33a
1 changed files with 19 additions and 6 deletions
|
@ -8,6 +8,23 @@
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const versions = require('./versions.json');
|
const versions = require('./versions.json');
|
||||||
|
|
||||||
|
// This probably only makes sense for the alpha phase, temporary
|
||||||
|
function getNextAlphaVersionName() {
|
||||||
|
const expectedPrefix = '2.0.0-alpha.';
|
||||||
|
|
||||||
|
const lastReleasedVersion = versions[0];
|
||||||
|
if (!lastReleasedVersion.includes(expectedPrefix)) {
|
||||||
|
throw new Error(
|
||||||
|
'this code is only meant to be used during the 2.0 alpha phase.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const alphaBuild = parseInt(
|
||||||
|
lastReleasedVersion.replace(expectedPrefix, ''),
|
||||||
|
10,
|
||||||
|
);
|
||||||
|
return `${expectedPrefix}${alphaBuild + 1}`;
|
||||||
|
}
|
||||||
|
|
||||||
const allDocHomesPaths = [
|
const allDocHomesPaths = [
|
||||||
'/docs/',
|
'/docs/',
|
||||||
'/docs/next/',
|
'/docs/next/',
|
||||||
|
@ -177,18 +194,14 @@ module.exports = {
|
||||||
showLastUpdateTime: true,
|
showLastUpdateTime: true,
|
||||||
remarkPlugins: [require('./src/plugins/remark-npm2yarn')],
|
remarkPlugins: [require('./src/plugins/remark-npm2yarn')],
|
||||||
disableVersioning: isVersioningDisabled,
|
disableVersioning: isVersioningDisabled,
|
||||||
lastVersion: isDev || isDeployPreview ? 'current' : undefined,
|
lastVersion: 'current',
|
||||||
onlyIncludeVersions:
|
onlyIncludeVersions:
|
||||||
!isVersioningDisabled && (isDev || isDeployPreview)
|
!isVersioningDisabled && (isDev || isDeployPreview)
|
||||||
? ['current', ...versions.slice(0, 2)]
|
? ['current', ...versions.slice(0, 2)]
|
||||||
: undefined,
|
: undefined,
|
||||||
versions: {
|
versions: {
|
||||||
current: {
|
current: {
|
||||||
// path: isDev || isDeployPreview ? '' : 'next',
|
label: `${getNextAlphaVersionName()} (unreleased)`,
|
||||||
label:
|
|
||||||
isDev || isDeployPreview
|
|
||||||
? `Next (${isDeployPreview ? 'deploy preview' : 'dev'})`
|
|
||||||
: 'Next',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue