Skip to content

Commit

Permalink
refactor($theme-default): refactor the gitlab edit links
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopkovacs committed Jul 23, 2020
1 parent 5310054 commit d4bb396
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/@vuepress/theme-default/components/PageEdit.vue
Expand Up @@ -92,12 +92,24 @@ export default {
)
}
const gitlab = /gitlab.com/
if (gitlab.test(repo)) {
const base = docsRepo
return (
base.replace(endingSlashRE, '')
+ `/-/edit`
+ `/${docsBranch}/`
+ (docsDir ? docsDir.replace(endingSlashRE, '') + '/' : '')
+ path
)
}
const base = outboundRE.test(docsRepo)
? docsRepo
: `https://github.com/${docsRepo}`
return (
base.replace(endingSlashRE, '')
+ (/gitlab.com/.test(repo) ? '/-/edit/' : '/edit')
+ '/edit'
+ `/${docsBranch}/`
+ (docsDir ? docsDir.replace(endingSlashRE, '') + '/' : '')
+ path
Expand Down

0 comments on commit d4bb396

Please sign in to comment.