From 2144db0f58dbd2bee99864179c21f0ae5339c109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Thu, 3 Mar 2022 13:20:02 +0100 Subject: [PATCH] fix(theme-common): breadcrumbs home bug in docs-only (#6824) --- .../src/utils/__tests__/routesUtils.test.ts | 2 +- packages/docusaurus-theme-common/src/utils/routesUtils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/docusaurus-theme-common/src/utils/__tests__/routesUtils.test.ts b/packages/docusaurus-theme-common/src/utils/__tests__/routesUtils.test.ts index 5f0e5d27c9..9e398dbcac 100644 --- a/packages/docusaurus-theme-common/src/utils/__tests__/routesUtils.test.ts +++ b/packages/docusaurus-theme-common/src/utils/__tests__/routesUtils.test.ts @@ -69,7 +69,7 @@ describe('routesUtils findHomePageRoute', () => { {path: '/b', exact: true}, { path: '/', - exact: false, + exact: undefined, routes: [{path: '/c', exact: true}, homePage], }, ], diff --git a/packages/docusaurus-theme-common/src/utils/routesUtils.ts b/packages/docusaurus-theme-common/src/utils/routesUtils.ts index 16057d947e..278b85d518 100644 --- a/packages/docusaurus-theme-common/src/utils/routesUtils.ts +++ b/packages/docusaurus-theme-common/src/utils/routesUtils.ts @@ -23,7 +23,7 @@ export function findHomePageRoute({ } function isHomeParentRoute(route: Route): boolean { - return route.path === baseUrl && route.exact === false; + return route.path === baseUrl && !route.exact; } function doFindHomePageRoute(routes: Route[]): Route | undefined {