File tree 2 files changed +15
-8
lines changed
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ node_modules
4
4
.temp
5
5
vuepress
6
6
TODOs.md
7
+ * .sw *
Original file line number Diff line number Diff line change 1
1
<template >
2
- <nav class =" nav-links" v-if =" userLinks.length || githubLink " >
2
+ <nav class =" nav-links" v-if =" userLinks.length || repoLink " >
3
3
<!-- user links -->
4
4
<div
5
5
class =" nav-item"
8
8
<DropdownLink v-if =" item.type === 'links'" :item =" item" />
9
9
<NavLink v-else :item =" item" />
10
10
</div >
11
- <!-- github link -->
12
- <a v-if =" githubLink "
13
- :href =" githubLink "
14
- class =" github -link"
11
+ <!-- repo link -->
12
+ <a v-if =" repoLink "
13
+ :href =" repoLink "
14
+ class =" repo -link"
15
15
target =" _blank"
16
16
rel =" noopener noreferrer" >
17
- GitHub
17
+ {{ repoLabel }}
18
18
<OutboundLink />
19
19
</a >
20
20
</nav >
@@ -69,14 +69,20 @@ export default {
69
69
})
70
70
}))
71
71
},
72
- githubLink () {
72
+ repoLink () {
73
73
const { repo } = this .$site .themeConfig
74
74
if (repo) {
75
75
return / ^ https? :/ .test (repo)
76
76
? repo
77
77
: ` https://github.com/${ repo} `
78
78
}
79
- }
79
+ },
80
+ repoLabel () {
81
+ const repoHost = this .repoLink .match (/ ^ https? :\/\/ [^ /] + / )[0 ] || ' github'
82
+ return [' GitHub' , ' GitLab' , ' Bitbucket' ].find (platform => {
83
+ return repoHost .toLowerCase ().includes (platform .toLowerCase ())
84
+ });
85
+ },
80
86
},
81
87
methods: {
82
88
isActive
You can’t perform that action at this time.
0 commit comments