diff --git a/docusaurus.config.js b/docusaurus.config.js index 9c9d526..0f80a7b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -14,7 +14,20 @@ const config = { outputFile: "llms.txt", // defaults to llms.txt if not specified }, ], +[ + 'docusaurus-plugin-copy-page-button', + { + customStyles: { + container: { + className: 'copyPageButtonContainer', + }, + button: { + style: { marginLeft: '8px' }, + }, + }, + }, ], + ], title: 'Chronicle Docs', tagline: 'Cost-efficient. Verifiable Data.', favicon: 'img/favicon.ico', diff --git a/package.json b/package.json index fde026f..6c80f59 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@mdx-js/react": "^3.0.0", "acorn-import-assertions": "^1.9.0", "clsx": "^2.0.0", + "docusaurus-plugin-copy-page-button": "^0.3.5", "docusaurus-plugin-generate-llms-txt": "^0.0.1", "docusaurus-plugin-sass": "^0.2.5", "prism-react-renderer": "^2.3.0", diff --git a/src/css/custom.css b/src/css/custom.css index bed3dad..800f0c1 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -53,4 +53,16 @@ } [data-theme='dark']:root .menu { background-color: #1F2937; -} \ No newline at end of file +} + +/* Hide the copy button by default */ +.copyPageButtonContainer { + display: none !important; +} + +/* Reenable only when it's inside the TOC sidebar */ +.theme-doc-toc-desktop .copyPageButtonContainer, +.theme-doc-toc-mobile .copyPageButtonContainer, +.table-of-contents .copyPageButtonContainer { + display: block !important; +} diff --git a/yarn.lock b/yarn.lock index 3b04f8d..ef893db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7211,6 +7211,11 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" +docusaurus-plugin-copy-page-button@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/docusaurus-plugin-copy-page-button/-/docusaurus-plugin-copy-page-button-0.3.5.tgz#a7fbed7aed346f6dfa82eb95b78216ca834c10b2" + integrity sha512-QwveQb/WM9r8E8qVqXOrZ6uz9YFOPQGV87RpemiemcDg5gQHyhSFenPP5twSrSRkIbT0D7f54lUbl3bbuVJfHg== + docusaurus-plugin-generate-llms-txt@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/docusaurus-plugin-generate-llms-txt/-/docusaurus-plugin-generate-llms-txt-0.0.1.tgz#e2104a73bdf59ea9f576f319e73e7d9c664e6ea8"