Skip to content

Commit fa8eee9

Browse files
committed
added option to customise repoLabel
1 parent 34ccc58 commit fa8eee9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/default-theme-config/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ next: false
216216
---
217217
```
218218

219-
## GitHub Repo and Edit Links
219+
## Git Repo and Edit Links
220220

221221
Providing `themeConfig.repo` auto generates a GitHub link in the navbar and "Edit this page" links at the bottom of each page.
222222

@@ -226,6 +226,8 @@ module.exports = {
226226
themeConfig: {
227227
// Assumes GitHub. Can also be a full GitLab url.
228228
repo: 'vuejs/vuepress',
229+
// Customising the header label
230+
repoLabel: 'Contribute!',
229231
// if your docs are not at the root of the repo
230232
docsDir: 'docs',
231233
// optional, defaults to master

lib/default-theme/NavLinks.vue

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export default {
7878
}
7979
},
8080
repoLabel () {
81+
if (this.$site.themeConfig.repoLabel) return this.$site.themeConfig.repoLabel
82+
8183
const repoHost = this.repoLink.match(/^https?:\/\/[^/]+/)[0] || 'github'
8284
return ['GitHub', 'GitLab', 'Bitbucket'].find(platform => {
8385
return repoHost.toLowerCase().includes(platform.toLowerCase())

0 commit comments

Comments
 (0)