Skip to content
duxt

DuxtCopyPage

Hand this page to a model, or read its source.

A split control beside the page title: copy the Markdown, view it, or open it in a chat model.

Usage

<DuxtCopyPage :path="path" :title="page?.title" :rawbody="page?.rawbody" />

API

Props

PropTypeNotes
pathstringRequired — the documentation path
titlestringUsed in the prompt handed to a model
rawbodystringThe Markdown source, for the copy button

Notes

A split control rather than four buttons — the common case is "copy it", and the other three are the same intention through a different door.

What all of them hand over is the Markdown, not the rendered page: a model given HTML has to undo a layout to find a heading, and one given the source reads what the author wrote. The frontmatter is stripped, so what is copied reads as the page rather than as the file.

The external links need an absolute URL, and the origin is read from the browser at click time rather than from config — the only value that is certainly right, including on a preview deployment whose domain nobody wrote down.

Was this page helpful?