mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-03 16:59:06 +02:00
feat(v2): docs options.onlyIncludeVersions (#3373)
* docs options.onlyIncludeVersions * adapt docsVersionDropdown if we render a single version * fix bad error message * fix netlify deploy when versioning is disabled
This commit is contained in:
parent
149d82c730
commit
d8cfabb66a
8 changed files with 144 additions and 22 deletions
|
@ -362,6 +362,11 @@ module.exports = {
|
|||
},
|
||||
*/
|
||||
},
|
||||
/**
|
||||
* Sometimes you only want to include a subset of all available versions.
|
||||
* Tip: limit to 2 or 3 versions to improve startup and build time in dev and deploy previews
|
||||
*/
|
||||
onlyIncludeVersions: undefined, // ex: ["current", "1.0.0", "2.0.0"]
|
||||
},
|
||||
],
|
||||
],
|
||||
|
|
|
@ -178,6 +178,10 @@ module.exports = {
|
|||
remarkPlugins: [require('./src/plugins/remark-npm2yarn')],
|
||||
disableVersioning: isVersioningDisabled,
|
||||
lastVersion: isDev || isDeployPreview ? 'current' : undefined,
|
||||
onlyIncludeVersions:
|
||||
!isVersioningDisabled && (isDev || isDeployPreview)
|
||||
? ['current', ...versions.slice(0, 2)]
|
||||
: undefined,
|
||||
versions: {
|
||||
current: {
|
||||
// path: isDev || isDeployPreview ? '' : 'next',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue