diff --git a/package.json b/package.json index 7ab3484d..a22d8994 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "vitepress", + "name": "@hey-api/vitepress", "version": "2.0.0-alpha.11", "description": "Vite & Vue powered static site generator", "keywords": [ diff --git a/src/shared/shared.ts b/src/shared/shared.ts index c556e723..1e3d9882 100644 --- a/src/shared/shared.ts +++ b/src/shared/shared.ts @@ -60,8 +60,22 @@ export function isActive( return new RegExp(matchPath).test(currentPath) } - if (normalize(matchPath) !== currentPath) { - return false + const normalizedMatchPath = normalize(matchPath) + + if (normalizedMatchPath !== currentPath) { + const currentPathParts = currentPath.split('/') + // handle versioned clients and plugins + if ( + currentPathParts.length > 3 && + (currentPathParts[2] === 'plugins' || currentPathParts[2] === 'clients') + ) { + currentPath = currentPathParts.slice(0, 4).join('/') + if (normalizedMatchPath !== currentPath) { + return false + } + } else { + return false + } } const hashMatch = matchPath.match(HASH_RE)