refactor(website): make deploy preview open next version docs by default (#6120)

* refactor(website): make deploy preview open next version docs by default

* Fix links
This commit is contained in:
Joshua Chen 2021-12-17 11:00:12 +08:00 committed by GitHub
parent 0c2765fb74
commit 7db4884853
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View file

@ -391,7 +391,7 @@ module.exports = {
};
```
See it in action in the [Docusaurus Guides pages](/docs/next/category/guides).
See it in action in the [Docusaurus Guides pages](/docs/category/guides).
:::tip

View file

@ -268,13 +268,15 @@ const config = {
remarkPlugins: [math, [npm2yarn, {sync: true}]],
rehypePlugins: [katex],
disableVersioning: isVersioningDisabled,
lastVersion: isDev ? 'current' : undefined,
// eslint-disable-next-line no-nested-ternary
onlyIncludeVersions: isBuildFast
? ['current']
: !isVersioningDisabled && (isDev || isDeployPreview)
? ['current', ...versions.slice(0, 2)]
: undefined,
lastVersion: isDev || isDeployPreview ? 'current' : undefined,
onlyIncludeVersions: (() => {
if (isBuildFast) {
return ['current'];
} else if (!isVersioningDisabled && (isDev || isDeployPreview)) {
return ['current', ...versions.slice(0, 2)];
}
return undefined;
})(),
versions: {
current: {
path: isDev || isBuildFast ? 'next' : undefined,

View file

@ -391,7 +391,7 @@ module.exports = {
};
```
See it in action in the [Docusaurus Guides pages](/docs/next/category/guides).
See it in action in the [Docusaurus Guides pages](/docs/category/guides).
:::tip

View file

@ -391,7 +391,7 @@ module.exports = {
};
```
See it in action in the [Docusaurus Guides pages](/docs/next/category/guides).
See it in action in the [Docusaurus Guides pages](/docs/category/guides).
:::tip