Edit Link

A link to the source file.

An edit link allows you to display a link at the end of each page to edit the page on GitHub / GitLab.

app.config.ts
export default defineAppConfig({
  shadcnDocs: {
    main: {
      editLink: {
        enable: true,
        pattern: 'https://github.com/ZTL-UwU/shadcn-docs-nuxt/edit/main/content/:path',
        text: 'Edit this page on GitHub',
        icon: 'lucide:square-pen',
        placement: ['docsFooter', 'toc'],
      },
    }
  },
});
  • The pattern option defines the URL structure for the link, and :path is going to be replaced with the page path.
  • The text option allows you to customize the link text (default is Edit this page)
  • The icon option allows you to customize the icon (default is lucide:square-pen)
  • The placement option controls the places to put the edit link.
    • docsFooter: at the end of the page.
    • toc: in the TOC links section.

Front Matter

The edit link can be disabled per-page using the editLink option in front matter.

---
editLink: false
---

Parameters

enableboolean
false
Whether to turn on the edit link.
patternstring
The link pattern.
textstring
Edit this page
Text displayed on the link.
iconstring
lucide:square-pen
The icon preceding the link.
placement('docsFooter' | 'toc')[]
['docsFooter']
Where to place the edit link.