From 58ac9f0c17a14a9603aa64690d52a1c11413638d Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 13:13:51 +0200 Subject: [PATCH 1/3] docs: Move DocItem to apify doc theme --- .../src/theme/DocItemContent}/index.js | 4 +++- src/theme/DocItem/Layout/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) rename {src/theme/DocItem/Content => apify-docs-theme/src/theme/DocItemContent}/index.js (95%) diff --git a/src/theme/DocItem/Content/index.js b/apify-docs-theme/src/theme/DocItemContent/index.js similarity index 95% rename from src/theme/DocItem/Content/index.js rename to apify-docs-theme/src/theme/DocItemContent/index.js index 9f0d1bc396..4cde6968f3 100644 --- a/src/theme/DocItem/Content/index.js +++ b/apify-docs-theme/src/theme/DocItemContent/index.js @@ -53,8 +53,10 @@ export default function DocItemContent({ children }) { const shouldShowLLMButtons = allowedPaths.some((path) => location.pathname.startsWith(path)); + console.error('DEBUG: shouldShowLLMButtons', shouldShowLLMButtons); + return ( -
+
{syntheticTitle && {syntheticTitle}} {shouldShowLLMButtons && } {children} diff --git a/src/theme/DocItem/Layout/index.js b/src/theme/DocItem/Layout/index.js index 25e007163c..4d1296f1cf 100644 --- a/src/theme/DocItem/Layout/index.js +++ b/src/theme/DocItem/Layout/index.js @@ -4,6 +4,7 @@ import { useColorMode, useWindowSize } from '@docusaurus/theme-common'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Giscus from '@giscus/react'; import ContentVisibility from '@theme/ContentVisibility'; +import DocItemContent from '@theme/DocItemContent'; import DocBreadcrumbs from '@theme/DocBreadcrumbs'; import DocItemFooter from '@theme/DocItem/Footer'; import DocItemPaginator from '@theme/DocItem/Paginator'; @@ -14,7 +15,6 @@ import DocVersionBanner from '@theme/DocVersionBanner'; import clsx from 'clsx'; import React, { useCallback } from 'react'; -import DocItemContent from '../Content'; import styles from './styles.module.css'; /** From c808f0fba4ebfbfcfcc7c05d0b55d055f59fede9 Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 13:14:25 +0200 Subject: [PATCH 2/3] Fix lint errors --- src/theme/DocItem/Layout/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/DocItem/Layout/index.js b/src/theme/DocItem/Layout/index.js index 4d1296f1cf..299bcd1515 100644 --- a/src/theme/DocItem/Layout/index.js +++ b/src/theme/DocItem/Layout/index.js @@ -4,12 +4,12 @@ import { useColorMode, useWindowSize } from '@docusaurus/theme-common'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import Giscus from '@giscus/react'; import ContentVisibility from '@theme/ContentVisibility'; -import DocItemContent from '@theme/DocItemContent'; import DocBreadcrumbs from '@theme/DocBreadcrumbs'; import DocItemFooter from '@theme/DocItem/Footer'; import DocItemPaginator from '@theme/DocItem/Paginator'; import DocItemTOCDesktop from '@theme/DocItem/TOC/Desktop'; import DocItemTOCMobile from '@theme/DocItem/TOC/Mobile'; +import DocItemContent from '@theme/DocItemContent'; import DocVersionBadge from '@theme/DocVersionBadge'; import DocVersionBanner from '@theme/DocVersionBanner'; import clsx from 'clsx'; From 8ff929d2af2c5ab073b27db7c217ea900cc9649c Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 13:15:22 +0200 Subject: [PATCH 3/3] Remove debug things --- apify-docs-theme/src/theme/DocItemContent/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apify-docs-theme/src/theme/DocItemContent/index.js b/apify-docs-theme/src/theme/DocItemContent/index.js index 4cde6968f3..9f0d1bc396 100644 --- a/apify-docs-theme/src/theme/DocItemContent/index.js +++ b/apify-docs-theme/src/theme/DocItemContent/index.js @@ -53,10 +53,8 @@ export default function DocItemContent({ children }) { const shouldShowLLMButtons = allowedPaths.some((path) => location.pathname.startsWith(path)); - console.error('DEBUG: shouldShowLLMButtons', shouldShowLLMButtons); - return ( -
+
{syntheticTitle && {syntheticTitle}} {shouldShowLLMButtons && } {children}