Skip to content

Commit

Permalink
docs: Update docs on how to use relativePath
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolechung committed Jun 21, 2023
1 parent f93dbf5 commit 2866085
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/ember/docs/components/docfy-output-demo/edit-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,35 @@ repository URL as well as the branch to edit.
{{/if}}
</DocfyOutput>
```

For this to work, you need to include `repository` in your docfy-config:

```js
// in your docfy-config.js
module.exports = {
repository: {
url: 'https://github.com/@username/repo-name',
editBranch: 'main',
},
...// rest of your config
}
```


## Enterprise (aka on premise) git services

`page.editUrl` works for Github, Bitbucket, Gitlab and Sourcehut.

For on-premise instances git solutions (i.e. on-premise Gitlab, or on-premise Bitbucket), we expose the `page.relativePath` so that you might construct your own custom editUrl:

```hbs
<DocfyOutput @fromCurrentURL={{true}} as |page|>
{{#if page.relativePath}}
<a href=(concat "http://some-enterpise.com/browse/" page.relativePath)
Click here to edit this page
</a>
{{/if}}
</DocfyOutput>
```

Note: the edit url for your on-premise instance might be more complex than the example above. But the `page.relativePath` will give you the relative path to that file in your repo.

0 comments on commit 2866085

Please sign in to comment.