From 4a28e55c19723e3737501994a3497b2b18be8693 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 08:08:37 +0000 Subject: [PATCH 1/2] Initial plan From 1c759e86c54e2e50cd32357df1eb74f2839e6103 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 08:19:53 +0000 Subject: [PATCH 2/2] Move carbon ads from page bottom to sidebar only Co-authored-by: ajnart <49837342+ajnart@users.noreply.github.com> --- src/components/carbon.tsx | 6 ++++-- src/theme/DocPaginator/index.tsx | 4 ---- src/theme/TOCItems/index.tsx | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/carbon.tsx b/src/components/carbon.tsx index 69db8e76..70071481 100644 --- a/src/components/carbon.tsx +++ b/src/components/carbon.tsx @@ -1,7 +1,7 @@ import { useLocation } from "@docusaurus/router"; import React, { useEffect } from "react"; -export function Carbon() { +export function Carbon({ sidebar = false }: { sidebar?: boolean } = {}) { const ref = React.useRef(null!); const location = useLocation(); if (process.env.NODE_ENV === "development") { @@ -85,7 +85,9 @@ export function Carbon() { data-visual-test="blackout" id="carbonads" data-selector="carbonads" - className="bg-background flex flex-col m-4 space-y-2 carbonads argos-ignore" + className={`bg-background flex flex-col carbonads argos-ignore ${ + sidebar ? "mt-6 mb-4 mx-0" : "m-4 space-y-2" + }`} /> ); diff --git a/src/theme/DocPaginator/index.tsx b/src/theme/DocPaginator/index.tsx index 3100dd22..608e54b2 100644 --- a/src/theme/DocPaginator/index.tsx +++ b/src/theme/DocPaginator/index.tsx @@ -1,5 +1,4 @@ import type { WrapperProps } from "@docusaurus/types"; -import { Carbon } from "@site/src/components/carbon"; import DocPaginator from "@theme-original/DocPaginator"; import type DocPaginatorType from "@theme/DocPaginator"; import { type ReactNode } from "react"; @@ -10,9 +9,6 @@ export default function DocPaginatorWrapper(props: Props): ReactNode { return ( <> -
- -
); } diff --git a/src/theme/TOCItems/index.tsx b/src/theme/TOCItems/index.tsx index ba0dc3c2..b7a556f8 100644 --- a/src/theme/TOCItems/index.tsx +++ b/src/theme/TOCItems/index.tsx @@ -10,7 +10,7 @@ export default function TOCItemsWrapper(props: Props): ReactNode { return ( <> - + ); }