Skip to content

Commit 5cad664

Browse files
Mister-Hopemeteorlxy
authored andcommitted
feat(theme-default): support Gitee repo
1 parent bbdda60 commit 5cad664

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/@vuepress/theme-default/src/client/utils/resolveEditLink.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { RepoType } from './resolveRepoType'
55
export const editLinkPatterns: Record<Exclude<RepoType, null>, string> = {
66
GitHub: ':repo/edit/:branch/:path',
77
GitLab: ':repo/-/edit/:branch/:path',
8+
Gitee: ':repo/edit/:branch/:path',
89
Bitbucket:
910
':repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default',
1011
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { isLinkHttp } from '@vuepress/shared'
22

3-
export type RepoType = 'GitHub' | 'GitLab' | 'Bitbucket' | null
3+
export type RepoType = 'GitHub' | 'GitLab' | 'Gitee' | 'Bitbucket' | null
44

55
export const resolveRepoType = (repo: string): RepoType => {
66
if (!isLinkHttp(repo)) return 'GitHub'
77
if (/bitbucket\.org/.test(repo)) return 'Bitbucket'
88
if (/gitlab\.com/.test(repo)) return 'GitLab'
9+
if (/gitee\.com/.test(repo)) return 'Gitee'
910
return null
1011
}

0 commit comments

Comments
 (0)