feat: add Copy page dropdown and View Markdown button#2942
Open
feat: add Copy page dropdown and View Markdown button#2942
Conversation
Adds a ViewMarkdown component that renders a "View Markdown" link button next to "Edit this page" in the feedback section, surfacing the raw .md URL that the markdownSource middleware already serves.
Adds a "Copy page" dropdown button at the top of the right-hand TOC sidebar with three options: - Copy page link: copies the current URL to clipboard - View Page as Markdown: opens the raw .md file in a new tab - Open in Claude: opens claude.ai pre-prompted to answer questions about the page using the markdown source URL
Lint rule pages are generated by lint_rule.page.tsx from source files in lint/rules/, which are excluded from Lume's processing pipeline via site.ignore(). This means the source .md files never made it into _site, causing 125 broken links in the link checker for /lint/rules/*.md URLs. The afterBuild hook now copies lint/rules/*.md directly into _site/lint/rules/ using Deno's file API, bypassing the ignore rules.
Move the "Copy page" dropdown from the TOC sidebar into the main content area, inline with the page H1. The button is right-aligned in a flex header row using <header> (not <div>) to avoid the markdown-body CSS column override. The dropdown panel is now absolutely positioned so it floats over content without shifting layout.
Fixes the CSS collision with .markdown-body details rules by switching CopyPage from <details>/<summary> to a proper split button. Left half copies the URL directly; right half opens a floating panel via the native Popover API (light-dismiss, Escape-to-close, top-layer stacking — no z-index needed).
…dling - Remove ViewMarkdown component and its usage in Feedback (covered by CopyPage popover's "View Page as Markdown" link) - Add .catch() to clipboard writeText so users see "Copy failed" instead of nothing on error - Simplify chevron transform logic in toggle handler - Remove redundant border: none reset in .copy-page-panel (immediately overridden by @apply border)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.mdsource.mdfile in a new tabclaude.aipre-prompted to read and answer questions about the page using the markdown source URL.mdfiles into_site/lint/rules/duringafterBuild— these were excluded from Lume's processing pipeline bysite.ignore()so they never landed in the output directoryTest plan
deno task serve/runtime/fundamentals/typescript/) and confirm the "Copy page" dropdown appears at the top of the right sidebar/lint/rules/no-var/) and confirm "View Markdown" button is visible and the link resolves/api/...) do not show either button