From 8082a0805a91b353349f15d33158e53f651aefe0 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Tue, 25 Nov 2025 09:24:57 -0700 Subject: [PATCH 1/3] Hide version dropdown on non-versioned paths --- .../NavbarItem/DocsVersionDropdownNavbarItem.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx diff --git a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx new file mode 100644 index 00000000..061ffa5f --- /dev/null +++ b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx @@ -0,0 +1,14 @@ +import React from 'react'; +import DocsVersionDropdownNavbarItem from '@theme-original/NavbarItem/DocsVersionDropdownNavbarItem'; +import {useLocation} from '@docusaurus/router'; +import type {Props} from '@theme/NavbarItem/DocsVersionDropdownNavbarItem'; + +function checkPathname(pathname: string) { + return pathname.startsWith('/fabric') || pathname.startsWith('/release-notes'); +} + +export default function DocsVersionDropdownNavbarItemWrapper(props: Props) { + const location = useLocation(); + + return checkPathname(location.pathname) ? null : ; +} \ No newline at end of file From 5aae802294de81f2ee432cb613a6eb6994ddedde Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Tue, 25 Nov 2025 09:27:57 -0700 Subject: [PATCH 2/3] format --- .../NavbarItem/DocsVersionDropdownNavbarItem.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx index 061ffa5f..7448020d 100644 --- a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +++ b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx @@ -1,14 +1,14 @@ import React from 'react'; import DocsVersionDropdownNavbarItem from '@theme-original/NavbarItem/DocsVersionDropdownNavbarItem'; -import {useLocation} from '@docusaurus/router'; -import type {Props} from '@theme/NavbarItem/DocsVersionDropdownNavbarItem'; +import { useLocation } from '@docusaurus/router'; +import type { Props } from '@theme/NavbarItem/DocsVersionDropdownNavbarItem'; function checkPathname(pathname: string) { - return pathname.startsWith('/fabric') || pathname.startsWith('/release-notes'); + return pathname.startsWith('/fabric') || pathname.startsWith('/release-notes'); } export default function DocsVersionDropdownNavbarItemWrapper(props: Props) { - const location = useLocation(); + const location = useLocation(); - return checkPathname(location.pathname) ? null : ; -} \ No newline at end of file + return checkPathname(location.pathname) ? null : ; +} From cd92b465caabcc654a86ab1c7241cac8fa3b8cc0 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Tue, 25 Nov 2025 09:35:50 -0700 Subject: [PATCH 3/3] rename func --- src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx index 7448020d..1d650a37 100644 --- a/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +++ b/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx @@ -3,12 +3,12 @@ import DocsVersionDropdownNavbarItem from '@theme-original/NavbarItem/DocsVersio import { useLocation } from '@docusaurus/router'; import type { Props } from '@theme/NavbarItem/DocsVersionDropdownNavbarItem'; -function checkPathname(pathname: string) { +function isNonVersionedPathname(pathname: string) { return pathname.startsWith('/fabric') || pathname.startsWith('/release-notes'); } export default function DocsVersionDropdownNavbarItemWrapper(props: Props) { const location = useLocation(); - return checkPathname(location.pathname) ? null : ; + return isNonVersionedPathname(location.pathname) ? null : ; }