Skip to content

Conversation

@kitlangton
Copy link

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Adds a “Copy page” action to Starlight docs. The custom PageTitle component bundles raw markdown at build time, ensures each document starts with its H1, and exposes it via a hidden template. A lightweight client script wires the button to copy the markdown and updates status messaging for success or failure.

@vercel
Copy link

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website-content Ready Ready Preview Comment Oct 26, 2025 8:13pm
website-landing Ready Ready Preview Comment Oct 26, 2025 8:13pm
website-proxy Ready Ready Preview Comment Oct 26, 2025 8:13pm

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a "Copy as markdown" button feature for Starlight documentation pages. The feature allows users to copy the raw markdown content of a page to their clipboard with a single click.

  • Adds build-time markdown bundling to avoid runtime file I/O operations
  • Implements client-side copy functionality with clipboard API and fallback support
  • Creates a custom PageTitle component that integrates the copy button into the page header

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
content/src/lib/markdown-map.ts Build-time markdown content bundling and retrieval utilities
content/src/components/starlight/copy-page.client.ts Client-side copy functionality with clipboard handling and UI state management
content/src/components/starlight/PageTitle.astro Custom PageTitle component with integrated copy button and styling
content/package.json Added onlyBuiltDependencies configuration
content/astro.config.ts Registered custom PageTitle component override

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kitlangton
Copy link
Author

kitlangton commented Oct 17, 2025

@IMax153 I think this is good to go actually :)
Do we get a preview site auto generated?

@IMax153
Copy link
Member

IMax153 commented Oct 24, 2025

@kitlangton - I fixed the issue I mentioned and deployed it to the preview env.

However, I'm not sure if it's just me, but it doesn't seem to be working in the live preview. Doesn't copy the page content.

@kitlangton
Copy link
Author

Hrm. Do you have a link to the preview?

@IMax153
Copy link
Member

IMax153 commented Oct 25, 2025

Hrm. Do you have a link to the preview?

@kitlangton you can click the preview link for website-content in the comment generated by Vercel at the top of the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants