Skip to content

Commit

Permalink
feat(theme-classic): implementation refactoring of version configurat…
Browse files Browse the repository at this point in the history
…ions in "docsVersionDropdown" navbar item
  • Loading branch information
hrumhurum committed Jan 19, 2025
1 parent bcae6cb commit 9e166c3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function configureVersions(
staticVersions?: PropVersions,
): ConfiguredVersion[] {
if (staticVersions) {
// The versions are configured.
// The versions are configured

// Collect all the versions we have
const versionMap = new Map<string, GlobalVersion>(
Expand All @@ -68,15 +68,15 @@ function configureVersions(
for (const version of versions) {
// 'version.name' has special conventions for current and next versions,
// that's why we use 'version.label' as a secondary version identifier
// that can be referenced in configuration.
// that can be referenced in configuration
const label = version.label;
if (!versionMap.has(label)) versionMap.set(label, version);
}

// Keep only versions specified in configuration, reorder them accordingly
const configuredVersions: ConfiguredVersion[] = [];
for (const configuration of getVersionConfigurations(staticVersions)) {
let version = versionMap.get(configuration.name);
const version = versionMap.get(configuration.name);
if (!version) {
// A version configuration references a non-existing version, ignore it
continue;
Expand Down

0 comments on commit 9e166c3

Please sign in to comment.