-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow custom edit links (#698)
close #694 close #697 Co-authored-by: Kia Ishii <[email protected]>
- Loading branch information
Showing
5 changed files
with
58 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
# 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' | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters