From 3c7e840ccd6b6887776ba65f146db5040975a5be Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 13:13:51 +0200 Subject: [PATCH 1/4] docs: Move DocItem to apify doc theme --- apify-docs-theme/src/theme/DocItemContent/index.js | 4 +++- src/theme/DocItem/Layout/index.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apify-docs-theme/src/theme/DocItemContent/index.js b/apify-docs-theme/src/theme/DocItemContent/index.js index 9f0d1bc396..4cde6968f3 100644 --- a/apify-docs-theme/src/theme/DocItemContent/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 299bcd1515..83d2a02379 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'; From 9ecd4d541d028b0b975bf81ffb528554d0588aa1 Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 13:14:25 +0200 Subject: [PATCH 2/4] Fix lint errors --- src/theme/DocItem/Layout/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/theme/DocItem/Layout/index.js b/src/theme/DocItem/Layout/index.js index 83d2a02379..299bcd1515 100644 --- a/src/theme/DocItem/Layout/index.js +++ b/src/theme/DocItem/Layout/index.js @@ -4,7 +4,6 @@ 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'; From b119c9718ae3f0a523befc9ff33650004b954efc Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 13:15:22 +0200 Subject: [PATCH 3/4] 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} From 8af1de647fbf332d8372f582c4ce79cdebad0c9e Mon Sep 17 00:00:00 2001 From: patrikbraborec Date: Wed, 27 Aug 2025 14:21:12 +0200 Subject: [PATCH 4/4] feat: Update DocItemContent description --- apify-docs-theme/src/theme/DocItemContent/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apify-docs-theme/src/theme/DocItemContent/index.js b/apify-docs-theme/src/theme/DocItemContent/index.js index 9f0d1bc396..f7a45f2695 100644 --- a/apify-docs-theme/src/theme/DocItemContent/index.js +++ b/apify-docs-theme/src/theme/DocItemContent/index.js @@ -18,11 +18,14 @@ function useSyntheticTitle() { return metadata.title; } +/** + * This component is also used in other Apify docs (clients, SDKs, CLI) + */ export default function DocItemContent({ children }) { const syntheticTitle = useSyntheticTitle(); const location = useLocation(); - // Define the allowed paths that should show LLMButtons (tag/info pages) + // Define the allowed paths that should show LLMButtons // The logic is handled here, and also in docusaurus.config.js (see docusaurus-plugin-openapi-docs) const allowedPaths = [ '/api/v2/getting-started',