page-actions
@farming-labs/docs — Page Actions
Page actions are buttons rendered above or below the page title. They let users copy the page as Markdown or open the page in an LLM (ChatGPT, Claude, Cursor, etc.). Use this skill when configuring these buttons.
Full docs: Page Actions.
Quick start
pageActions: {
copyMarkdown: { enabled: true },
openDocs: { enabled: true },
}
This adds Copy Markdown and an Open in... dropdown with default providers.
Configuration reference
All options go inside the pageActions object in docs.config.ts.
pageActions.position
Where the buttons appear relative to the page title.
| Type | Default |
|---|---|
"above-title" | "below-title" |
"below-title" |
pageActions: {
position: "above-title",
copyMarkdown: { enabled: true },
openDocs: { enabled: true },
}
Copy Markdown
pageActions.copyMarkdown
Show the "Copy Markdown" button. Copies the current page content as Markdown to the clipboard.
| Type | Default |
|---|---|
boolean | { enabled: boolean } |
false |
pageActions: {
copyMarkdown: true,
// or
copyMarkdown: { enabled: true },
}
Open in LLM (Open in...)
The Open in... dropdown lets users send the current page to an LLM or tool. Each provider has a link that can include the page URL (and optionally GitHub edit URL) as context.
pageActions.openDocs
Enable the "Open in..." dropdown. Can be a boolean or an object.
| Type | Default |
|---|---|
boolean | OpenDocsConfig |
false |
pageActions: {
openDocs: true,
}
When true, a default list of providers (e.g. GitHub, ChatGPT, Claude, Cursor) is used.
pageActions.openDocs.providers
Custom list of providers. Overrides the default list. Each provider has:
interface OpenDocsProvider {
name: string; // Display name (e.g. "ChatGPT", "Claude")
icon?: ReactNode; // Optional icon element
urlTemplate: string; // URL template; placeholders are replaced
}
URL template placeholders
| Placeholder | Replaced with |
|---|---|
{url} |
Current page URL (e.g. https://docs.example.com/docs/installation) |
{mdxUrl} |
.mdx variant of the page URL (for raw source) |
{githubUrl} |
GitHub edit URL for the current page. Requires github in config. Use urlTemplate: "{githubUrl}" for "Open in GitHub". |
Custom providers example
pageActions: {
openDocs: {
enabled: true,
providers: [
{
name: "ChatGPT",
urlTemplate: "https://chatgpt.com/?q=Read+this+documentation:+{url}",
},
{
name: "Claude",
urlTemplate: "https://claude.ai/new?q=Read+this+documentation:+{url}",
},
{
name: "Cursor",
urlTemplate: "https://cursor.com/link/prompt?text=Read+this+documentation:+{url}",
},
{
name: "GitHub",
urlTemplate: "{githubUrl}",
},
],
},
}
For {githubUrl} to work, the top-level github config must be set (e.g. github: { url: "https://github.com/owner/repo", directory: "website" }).
Edge cases
- No github config —
{githubUrl}will be empty or fallback; "Open in GitHub" may not work unlessgithubis set indefineDocs(). - Custom icon — Pass a React node (or SVG component) as
iconfor each provider if you want a custom icon. - Alignment — Page actions alignment (left/right) is controlled by
pageActions.alignmentin config (e.g."left"or"right"); see API reference if available.
Resources
- Full Page Actions docs: docs.farming-labs.dev/docs/customization/page-actions
- Configuration: use the
configurationskill forgithuband other top-level options.
More from farming-labs/docs
farming-labs-docs
Get started with @farming-labs/docs — MDX-based documentation for Next.js, SvelteKit, Astro, and Nuxt. Use when setting up docs, scaffolding with the CLI, choosing themes, or writing docs.config. Covers init, --template, manual setup, and theme CSS.
34ask-ai
Configure the Ask AI (RAG-powered AI chat) in @farming-labs/docs. Use when enabling AI chat, setting mode (search vs floating), floatingStyle (panel, modal, popover, full-modal), position, providers, models, suggestedQuestions, apiKey, systemPrompt, or maxResults. Covers Next.js, SvelteKit, Astro, Nuxt and env vars.
2configuration
docs.config.ts options for @farming-labs/docs. Use when configuring entry, contentDir, theme, staticExport, nav, github, themeToggle, breadcrumb, sidebar, icons, components, metadata, og, onCopyClick, pageActions, or ai. Covers Next.js, SvelteKit, Astro, Nuxt config file location.
2creating-themes
Create and share a custom theme for @farming-labs/docs. Use when building a theme with createTheme(), extendTheme(), cherry-picking built-in defaults, publishing as npm package, or adding CSS overrides. Covers ui.colors, typography, layout, sidebar, radius, and package layout for publishing.
2getting-started
Get started with @farming-labs/docs — MDX-based documentation for Next.js, SvelteKit, Astro, and Nuxt. Use when setting up docs, scaffolding with the CLI, choosing themes, or writing docs.config. Covers init, manual setup per framework, theme CSS, defineDocs, entry, contentDir, and common gotchas.
2