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:
Sébastien Lorber 2020-08-31 17:08:24 +02:00 committed by GitHub
parent 149d82c730
commit d8cfabb66a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 144 additions and 22 deletions

View file

@ -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',