Skip to content

Commit

Permalink
added support for link to custom repository. (#595)
Browse files Browse the repository at this point in the history
Added support for link to custom repository.
Now the repository should have a known structure, although for direct link it is not necessary.
  • Loading branch information
ejuo authored and swyxio committed Jan 31, 2019
1 parent 3016ee2 commit 34e404f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/docz-core/src/utils/repo-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ export const getRepoUrl = () => {

return (
repo &&
repo.browsetemplate &&
repo.browsetemplate
.replace('{domain}', repo.domain)
.replace('{user}', repo.user)
.replace('{project}', repo.project)
.replace('{/tree/committish}', '')
((repo.browsetemplate &&
repo.browsetemplate
.replace('{domain}', repo.domain)
.replace('{user}', repo.user)
.replace('{project}', repo.project)
.replace('{/tree/committish}', '')) ||
(repo.browse && repo.browse()))
)
}

Expand Down

0 comments on commit 34e404f

Please sign in to comment.