diff --git a/_components/CopyPage.tsx b/_components/CopyPage.tsx new file mode 100644 index 000000000..1d939f616 --- /dev/null +++ b/_components/CopyPage.tsx @@ -0,0 +1,111 @@ +export default function CopyPage({ file }: { file: string | undefined }) { + if (!file || file.includes("[")) return null; + + const markdownUrl = `https://docs.deno.com${file}`; + const claudeUrl = `https://claude.ai/new?q=${ + encodeURIComponent( + `Read this page from the Deno docs: ${markdownUrl} and answer questions about the content.`, + ) + }`; + + return ( +
+ {/* Primary: directly copies the URL */} + + + {/* Visual divider between the two halves */} + + + {/* Chevron: opens the popover panel */} + + + {/* Popover panel — lives in top layer, positioned via JS */} +
+ + + + View Page as Markdown + + Open the Markdown file in a new tab + + + + + + + Open in Claude + + Ask Claude about this page + + + +
+
+ ); +} diff --git a/_components/TableOfContents.tsx b/_components/TableOfContents.tsx index cc66b47de..2528ce61f 100644 --- a/_components/TableOfContents.tsx +++ b/_components/TableOfContents.tsx @@ -12,7 +12,7 @@ export default function TableOfContents({ data, toc, hasSubNav }: { return (