mirror of https://github.com/vuejs/vitepress
feat: allow custom edit links (#698)
close #694 close #697 Co-authored-by: Kia Ishii <kia.king.08@gmail.com>pull/731/head
parent
cf99dccfc4
commit
535e176b9a
@ -1,3 +1,28 @@
|
|||||||
# Edit Link
|
# Edit Link
|
||||||
|
|
||||||
Documentation coming soon...
|
Edit Link lets you display a link to edit the page on Git management services such as GitHub, or GitLab. To enable it, add `themeConfig.editLink` options to your config.
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
themeConfig: {
|
||||||
|
editLink: {
|
||||||
|
pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `pattern` option defines the URL structure for the link, and `:path` is going to be replaced with the page path.
|
||||||
|
|
||||||
|
By default, this will add the link text "Edit this page" at the bottom of the doc page. You may customize this text by defining the `text` option.
|
||||||
|
|
||||||
|
```js
|
||||||
|
export default {
|
||||||
|
themeConfig: {
|
||||||
|
editLink: {
|
||||||
|
pattern: 'https://github.com/vuejs/vitepress/edit/main/docs/:path',
|
||||||
|
text: 'Edit this page on GitHub'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Loading…
Reference in new issue