From 6ecabcc72f5667a508aee99456b2961dd354cc5d Mon Sep 17 00:00:00 2001 From: port <108868128+portdeveloper@users.noreply.github.com> Date: Wed, 13 May 2026 19:37:18 +0000 Subject: [PATCH 1/5] docs: add docusaurus-plugin-copy-page-button --- docusaurus.config.js | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index 3288ffc7371..8c1e866c603 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -371,6 +371,7 @@ module.exports = { versions: VERSIONS_JSON, }, ], + 'docusaurus-plugin-copy-page-button', ], customFields: {}, themes: [], diff --git a/package.json b/package.json index 6fd279bd2af..0dc3e85463c 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "clsx": "^1.1.1", "concurrently": "^6.2.0", "crowdin": "^3.5.0", + "docusaurus-plugin-copy-page-button": "^0.4.2", "docusaurus-plugin-module-alias": "^0.0.2", "docusaurus-plugin-sass": "^0.2.6", "fs-extra": "^9.1.0", From bba5788df9956056bfad66468d61253a3b0f4c81 Mon Sep 17 00:00:00 2001 From: Brandy Smith <6577830+brandyscarney@users.noreply.github.com> Date: Wed, 20 May 2026 14:31:57 -0400 Subject: [PATCH 2/5] chore: update package-lock --- package-lock.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package-lock.json b/package-lock.json index 1f0faeaf2c9..bd2c496283d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "clsx": "^1.1.1", "concurrently": "^6.2.0", "crowdin": "^3.5.0", + "docusaurus-plugin-copy-page-button": "^0.4.2", "docusaurus-plugin-module-alias": "^0.0.2", "docusaurus-plugin-sass": "^0.2.6", "fs-extra": "^9.1.0", @@ -8031,6 +8032,19 @@ "node": ">=6" } }, + "node_modules/docusaurus-plugin-copy-page-button": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-copy-page-button/-/docusaurus-plugin-copy-page-button-0.4.3.tgz", + "integrity": "sha512-4UzG7okbdRFkiKd1JoSW77Sri2IKxu7kUP6Iu8E2mMVp12nxJxjj7NRIIs23HkMpa7zqygu7SKnENul/oUXPGA==", + "license": "MIT", + "engines": { + "node": ">=18.0" + }, + "peerDependencies": { + "@docusaurus/core": "^3.0.0", + "react": "^18.0.0 || ^19.0.0" + } + }, "node_modules/docusaurus-plugin-module-alias": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/docusaurus-plugin-module-alias/-/docusaurus-plugin-module-alias-0.0.2.tgz", From 7bed11501302a779f43b0734e47850331b4a0112 Mon Sep 17 00:00:00 2001 From: port <108868128+portdeveloper@users.noreply.github.com> Date: Thu, 21 May 2026 19:24:11 +0000 Subject: [PATCH 3/5] Place copy page button in docs sidebar --- docusaurus.config.js | 7 ++++++- package-lock.json | 8 ++++---- package.json | 2 +- src/theme/DocItem/Layout/index.tsx | 11 +++++++++++ src/theme/DocItem/Layout/styles.module.css | 21 +++++++++++++++++++++ src/theme/DocSidebar/index.tsx | 11 +++++++++++ src/theme/DocSidebar/styles.module.css | 18 ++++++++++++++++++ 7 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 src/theme/DocItem/Layout/styles.module.css create mode 100644 src/theme/DocSidebar/styles.module.css diff --git a/docusaurus.config.js b/docusaurus.config.js index 8c1e866c603..69c8864bda8 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -371,7 +371,12 @@ module.exports = { versions: VERSIONS_JSON, }, ], - 'docusaurus-plugin-copy-page-button', + [ + 'docusaurus-plugin-copy-page-button', + { + injectButton: false, + }, + ], ], customFields: {}, themes: [], diff --git a/package-lock.json b/package-lock.json index bd2c496283d..dff1b185d42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "clsx": "^1.1.1", "concurrently": "^6.2.0", "crowdin": "^3.5.0", - "docusaurus-plugin-copy-page-button": "^0.4.2", + "docusaurus-plugin-copy-page-button": "^0.6.1", "docusaurus-plugin-module-alias": "^0.0.2", "docusaurus-plugin-sass": "^0.2.6", "fs-extra": "^9.1.0", @@ -8033,9 +8033,9 @@ } }, "node_modules/docusaurus-plugin-copy-page-button": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/docusaurus-plugin-copy-page-button/-/docusaurus-plugin-copy-page-button-0.4.3.tgz", - "integrity": "sha512-4UzG7okbdRFkiKd1JoSW77Sri2IKxu7kUP6Iu8E2mMVp12nxJxjj7NRIIs23HkMpa7zqygu7SKnENul/oUXPGA==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/docusaurus-plugin-copy-page-button/-/docusaurus-plugin-copy-page-button-0.6.1.tgz", + "integrity": "sha512-84LUG23owdGlUx5rgg7lcyuuxFZ+84u9u+adYjFZ1E5lM+g6bkduOGcZXLUqbI0R2Ve2RjG0OPv2KaL01tGW4w==", "license": "MIT", "engines": { "node": ">=18.0" diff --git a/package.json b/package.json index 0dc3e85463c..e66666b70e9 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "clsx": "^1.1.1", "concurrently": "^6.2.0", "crowdin": "^3.5.0", - "docusaurus-plugin-copy-page-button": "^0.4.2", + "docusaurus-plugin-copy-page-button": "^0.6.1", "docusaurus-plugin-module-alias": "^0.0.2", "docusaurus-plugin-sass": "^0.2.6", "fs-extra": "^9.1.0", diff --git a/src/theme/DocItem/Layout/index.tsx b/src/theme/DocItem/Layout/index.tsx index 218f71d0fc6..5962da2e4db 100644 --- a/src/theme/DocItem/Layout/index.tsx +++ b/src/theme/DocItem/Layout/index.tsx @@ -13,6 +13,7 @@ import React from 'react'; import clsx from 'clsx'; import {useWindowSize} from '@docusaurus/theme-common'; import {useDoc} from '@docusaurus/plugin-content-docs/client'; +import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; import DocItemPaginator from '@theme/DocItem/Paginator'; import DocVersionBanner from '@theme/DocVersionBanner'; import DocVersionBadge from '@theme/DocVersionBadge'; @@ -23,6 +24,7 @@ import DocItemContent from '@theme/DocItem/Content'; import ContentVisibility from '@theme/ContentVisibility'; import type {Props} from '@theme/DocItem/Layout'; import styles from '@docusaurus/theme-classic/lib/theme/DocItem/Layout/styles.module.css'; +import copyPageStyles from './styles.module.css'; // CUSTOM CODE import DocDemo from '@components/global/DocDemo'; @@ -86,6 +88,15 @@ export default function DocItemLayout({children, ...props}: Props): JSX.Element
{docTOC.mobile} +
+ +
{children}
diff --git a/src/theme/DocItem/Layout/styles.module.css b/src/theme/DocItem/Layout/styles.module.css new file mode 100644 index 00000000000..d005101a2e1 --- /dev/null +++ b/src/theme/DocItem/Layout/styles.module.css @@ -0,0 +1,21 @@ +.copyPageArticleAction { + display: flex; + justify-content: flex-end; + min-height: 37px; + margin-bottom: 1rem; +} + +.copyPageContainer { + display: inline-block; +} + +.copyPageButton, +.copyPageDropdown { + font-family: var(--ifm-font-family-base); +} + +@media (min-width: 997px) { + .copyPageArticleAction { + display: none; + } +} diff --git a/src/theme/DocSidebar/index.tsx b/src/theme/DocSidebar/index.tsx index 5267a996e0e..c3c3eca2d9c 100644 --- a/src/theme/DocSidebar/index.tsx +++ b/src/theme/DocSidebar/index.tsx @@ -8,10 +8,12 @@ import React, { useEffect } from 'react'; import { useLocation } from '@docusaurus/router'; +import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; import DocSidebar from '@theme-original/DocSidebar'; import type { Props } from '@theme/DocSidebar'; import Logo from '@theme-original/Logo'; +import styles from './styles.module.css'; export default function DocSidebarWrapper(props: Props): JSX.Element { const location = useLocation(); @@ -28,6 +30,15 @@ export default function DocSidebarWrapper(props: Props): JSX.Element { return ( <> +
+ +
); diff --git a/src/theme/DocSidebar/styles.module.css b/src/theme/DocSidebar/styles.module.css new file mode 100644 index 00000000000..ace251f1511 --- /dev/null +++ b/src/theme/DocSidebar/styles.module.css @@ -0,0 +1,18 @@ +.copyPageAction { + padding: 0 var(--sidebar-spacing-horizontal) 1rem; +} + +.copyPageContainer { + display: block; + width: 100%; +} + +.copyPageButton { + width: 100%; + justify-content: space-between; + font-family: var(--ifm-font-family-base); +} + +.copyPageDropdown { + font-family: var(--ifm-font-family-base); +} From 9804a4fc892738963b81523a17a84bd3dacd82d4 Mon Sep 17 00:00:00 2001 From: port <108868128+portdeveloper@users.noreply.github.com> Date: Wed, 27 May 2026 06:01:58 +0000 Subject: [PATCH 4/5] Move copy-page button from left sidebar to top of TOC (right sidebar) --- src/theme/DocItem/TOC/Desktop/index.tsx | 27 +++++++++++++++++++ .../TOC/Desktop}/styles.module.css | 2 +- src/theme/DocSidebar/index.tsx | 11 -------- 3 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 src/theme/DocItem/TOC/Desktop/index.tsx rename src/theme/{DocSidebar => DocItem/TOC/Desktop}/styles.module.css (82%) diff --git a/src/theme/DocItem/TOC/Desktop/index.tsx b/src/theme/DocItem/TOC/Desktop/index.tsx new file mode 100644 index 00000000000..2f1b3770a09 --- /dev/null +++ b/src/theme/DocItem/TOC/Desktop/index.tsx @@ -0,0 +1,27 @@ +/** + * Wraps the original DocItem/TOC/Desktop to render the page-level + * copy/AI dropdown above the "Contents" heading in the right sidebar. + */ + +import React from 'react'; +import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; +import TOCDesktop from '@theme-original/DocItem/TOC/Desktop'; + +import styles from './styles.module.css'; + +export default function TOCDesktopWrapper(): JSX.Element { + return ( + <> +
+ +
+ + + ); +} diff --git a/src/theme/DocSidebar/styles.module.css b/src/theme/DocItem/TOC/Desktop/styles.module.css similarity index 82% rename from src/theme/DocSidebar/styles.module.css rename to src/theme/DocItem/TOC/Desktop/styles.module.css index ace251f1511..51410ce9759 100644 --- a/src/theme/DocSidebar/styles.module.css +++ b/src/theme/DocItem/TOC/Desktop/styles.module.css @@ -1,5 +1,5 @@ .copyPageAction { - padding: 0 var(--sidebar-spacing-horizontal) 1rem; + margin-bottom: 1rem; } .copyPageContainer { diff --git a/src/theme/DocSidebar/index.tsx b/src/theme/DocSidebar/index.tsx index c3c3eca2d9c..5267a996e0e 100644 --- a/src/theme/DocSidebar/index.tsx +++ b/src/theme/DocSidebar/index.tsx @@ -8,12 +8,10 @@ import React, { useEffect } from 'react'; import { useLocation } from '@docusaurus/router'; -import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; import DocSidebar from '@theme-original/DocSidebar'; import type { Props } from '@theme/DocSidebar'; import Logo from '@theme-original/Logo'; -import styles from './styles.module.css'; export default function DocSidebarWrapper(props: Props): JSX.Element { const location = useLocation(); @@ -30,15 +28,6 @@ export default function DocSidebarWrapper(props: Props): JSX.Element { return ( <> -
- -
); From 5c514ac6bbb7786f29568abfe3f8590c6520a45f Mon Sep 17 00:00:00 2001 From: port <108868128+portdeveloper@users.noreply.github.com> Date: Wed, 27 May 2026 06:45:02 +0000 Subject: [PATCH 5/5] Move copy-page button inside TOC wrapper, above 'Contents' --- src/theme/DocItem/TOC/Desktop/index.tsx | 27 ------------------- src/theme/TOC/index.tsx | 12 +++++++++ .../TOC/Desktop => TOC}/styles.module.css | 10 +++---- 3 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 src/theme/DocItem/TOC/Desktop/index.tsx rename src/theme/{DocItem/TOC/Desktop => TOC}/styles.module.css (60%) diff --git a/src/theme/DocItem/TOC/Desktop/index.tsx b/src/theme/DocItem/TOC/Desktop/index.tsx deleted file mode 100644 index 2f1b3770a09..00000000000 --- a/src/theme/DocItem/TOC/Desktop/index.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Wraps the original DocItem/TOC/Desktop to render the page-level - * copy/AI dropdown above the "Contents" heading in the right sidebar. - */ - -import React from 'react'; -import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; -import TOCDesktop from '@theme-original/DocItem/TOC/Desktop'; - -import styles from './styles.module.css'; - -export default function TOCDesktopWrapper(): JSX.Element { - return ( - <> -
- -
- - - ); -} diff --git a/src/theme/TOC/index.tsx b/src/theme/TOC/index.tsx index f86a1aa134a..7eade4281c5 100644 --- a/src/theme/TOC/index.tsx +++ b/src/theme/TOC/index.tsx @@ -11,12 +11,15 @@ import React, { useState, useEffect } from 'react'; import TOC from '@theme-original/TOC'; import type { Props } from '@theme/TOC'; +import CopyPageButton from 'docusaurus-plugin-copy-page-button/react'; import EditThisPage from '@theme-original/EditThisPage'; import { useLocation } from '@docusaurus/router'; import { usePluginData } from '@docusaurus/useGlobalData'; import { PrismicRichText } from '@prismicio/react'; import { useDoc } from '@docusaurus/plugin-content-docs/client'; +import styles from './styles.module.css'; + interface TOCProps extends Props { editUrl: string; } @@ -37,6 +40,15 @@ export default function TOCWrapper(props: TOCProps): JSX.Element { return (
+
+ +

Contents

diff --git a/src/theme/DocItem/TOC/Desktop/styles.module.css b/src/theme/TOC/styles.module.css similarity index 60% rename from src/theme/DocItem/TOC/Desktop/styles.module.css rename to src/theme/TOC/styles.module.css index 51410ce9759..229ad550eea 100644 --- a/src/theme/DocItem/TOC/Desktop/styles.module.css +++ b/src/theme/TOC/styles.module.css @@ -1,16 +1,16 @@ .copyPageAction { - margin-bottom: 1rem; + margin-bottom: 0.5rem; } .copyPageContainer { - display: block; - width: 100%; + display: inline-block; } .copyPageButton { - width: 100%; - justify-content: space-between; font-family: var(--ifm-font-family-base); + font-size: 0.85rem; + padding: 0.25rem 0.6rem; + gap: 0.35rem; } .copyPageDropdown {