From eba5fbb7cc42125991b664c9dbacd7c1a712b657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCller?= Date: Tue, 24 Nov 2026 11:38:29 +0100 Subject: [PATCH] TabItem: remove workaround to un-hide tabs We used this workaround not to use "hidden" for compatibility with AI scrapers like Gemini Notebook (former NotebookLM). The current workaround is not compatible with the current (updated) docusaurus. We'll drop it for now and see if the scrapers handle it fine now. --- src/theme/TabItem/index.tsx | 35 ----------------------------- src/theme/TabItem/styles.module.css | 17 -------------- 2 files changed, 52 deletions(-) delete mode 100644 src/theme/TabItem/index.tsx delete mode 100644 src/theme/TabItem/styles.module.css diff --git a/src/theme/TabItem/index.tsx b/src/theme/TabItem/index.tsx deleted file mode 100644 index 91055fe99b0..00000000000 --- a/src/theme/TabItem/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import TabItem from '@theme-original/TabItem'; -import type {WrapperProps} from '@docusaurus/types'; -import styles from './styles.module.css'; - -type Props = WrapperProps; - -// Wrapper for TabItem to hide the tab content visually but keep it in the DOM for scrapers -// uses https://docusaurus.io/docs/swizzling#wrapping -// to wrap the original TabItem component and add a contextual label based on the tab value -export default function TabItemWrapper(props: Props): JSX.Element { - const {hidden, value, ...otherProps} = props; - - // Generate contextual label based on tab value - const getContextLabel = (tabValue: string) => { - if (tabValue === 'on-premises') return 'On premises example:'; - if (tabValue === 'hosted') return 'Hosted example:'; - if (tabValue === 'bootc') return 'Bootc example:'; - // Fallback for other tab values - return `${tabValue} example:`; - }; - - return ( -
-
- {getContextLabel(value)} -
- -
- ); -} diff --git a/src/theme/TabItem/styles.module.css b/src/theme/TabItem/styles.module.css deleted file mode 100644 index ff5e356094a..00000000000 --- a/src/theme/TabItem/styles.module.css +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Hide content visually but keep it in the DOM for scrapers - * Using clip instead of display:none or visibility:hidden - * This makes content invisible but still accessible to crawlers - */ -.hiddenTabItem, -.contextLabel { - position: absolute !important; - width: 1px !important; - height: 1px !important; - padding: 0 !important; - margin: -1px !important; - overflow: hidden !important; - clip: rect(0, 0, 0, 0) !important; - white-space: nowrap !important; - border: 0 !important; -}