mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-20 01:57:52 +02:00
Replace versionPathPart with function
Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
parent
90196bbf47
commit
2dc74ddc3f
1 changed files with 7 additions and 3 deletions
|
@ -288,9 +288,13 @@ function createVersionMetadata({
|
|||
// retro-compatible values
|
||||
const defaultVersionLabel =
|
||||
versionName === CURRENT_VERSION_NAME ? 'Next' : versionName;
|
||||
const versionNameNotLast =
|
||||
versionName === CURRENT_VERSION_NAME ? 'next' : versionName;
|
||||
const defaultVersionPathPart = isLast ? '' : versionNameNotLast;
|
||||
function getDefaultVersionPathPart() {
|
||||
if (isLast) {
|
||||
return '';
|
||||
}
|
||||
return versionName === CURRENT_VERSION_NAME ? 'next' : versionName;
|
||||
}
|
||||
const defaultVersionPathPart = getDefaultVersionPathPart();
|
||||
|
||||
const versionOptions: VersionOptions = options.versions[versionName] ?? {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue