diff --git a/packages/nextra-theme-blog/CHANGELOG.md b/packages/nextra-theme-blog/CHANGELOG.md index fb9bf8966c..d03197d3ef 100644 --- a/packages/nextra-theme-blog/CHANGELOG.md +++ b/packages/nextra-theme-blog/CHANGELOG.md @@ -61,6 +61,13 @@ - Updated dependencies [99f34d3] - nextra@4.0.0-app-router.0 +## 3.0.2 + +### Patch Changes + +- Updated dependencies [b6341f7] + - nextra@3.0.2 + ## 3.0.1 ### Patch Changes diff --git a/packages/nextra-theme-docs/CHANGELOG.md b/packages/nextra-theme-docs/CHANGELOG.md index 17fcfb9fab..5556b85614 100644 --- a/packages/nextra-theme-docs/CHANGELOG.md +++ b/packages/nextra-theme-docs/CHANGELOG.md @@ -72,6 +72,15 @@ - Updated dependencies [99f34d3] - nextra@4.0.0-app-router.0 +## 3.0.2 + +### Patch Changes + +- 991b69a: handle empty `item.route` in `` for + `item.type: 'menu'` +- Updated dependencies [b6341f7] + - nextra@3.0.2 + ## 3.0.1 ### Patch Changes diff --git a/packages/nextra-theme-docs/src/components/sidebar.tsx b/packages/nextra-theme-docs/src/components/sidebar.tsx index 08f605b908..90f0530a6d 100644 --- a/packages/nextra-theme-docs/src/components/sidebar.tsx +++ b/packages/nextra-theme-docs/src/components/sidebar.tsx @@ -74,8 +74,10 @@ type FolderProps = { function Folder({ item, anchors, onFocus, level }: FolderProps): ReactElement { const routeOriginal = useFSRoute() const [route] = routeOriginal.split('#') - const active = [route, route + '/'].includes(item.route + '/') - const activeRouteInside = active || route.startsWith(item.route + '/') + const hasRoute = !!item.route // for item.type === 'menu' will be '' + const active = hasRoute && [route, route + '/'].includes(item.route + '/') + const activeRouteInside = + active || (hasRoute && route.startsWith(item.route + '/')) const focusedRoute = useFocusedRoute() const focusedRouteInside = focusedRoute.startsWith(item.route + '/') @@ -130,7 +132,6 @@ function Folder({ item, anchors, onFocus, level }: FolderProps): ReactElement { item.children = Object.entries(menu.items || {}).map(([key, item]) => { const route = routes[key] || { name: key, - ...('locale' in menu && { locale: menu.locale }), route: menu.route + '/' + key } return { diff --git a/packages/nextra/CHANGELOG.md b/packages/nextra/CHANGELOG.md index 73f7cb2e68..1d6692dd96 100644 --- a/packages/nextra/CHANGELOG.md +++ b/packages/nextra/CHANGELOG.md @@ -35,6 +35,13 @@ Router, something may be broken, check https://github.com/shuding/nextra/tree/v4-v2/examples for the migration guide +## 3.0.2 + +### Patch Changes + +- b6341f7: remove warning + `Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir 'path-to-your-node_modules/next/dist/pages/_app.js'` + ## 3.0.1 ## 3.0.0