From 2866085126a5bf02d44320fedb9b77da22c8b7cb Mon Sep 17 00:00:00 2001 From: Nicole Chung <771170+nicolechung@users.noreply.github.com> Date: Wed, 21 Jun 2023 16:23:46 -0400 Subject: [PATCH] docs: Update docs on how to use relativePath --- .../components/docfy-output-demo/edit-page.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/ember/docs/components/docfy-output-demo/edit-page.md b/packages/ember/docs/components/docfy-output-demo/edit-page.md index facf604..7561af0 100644 --- a/packages/ember/docs/components/docfy-output-demo/edit-page.md +++ b/packages/ember/docs/components/docfy-output-demo/edit-page.md @@ -20,3 +20,35 @@ repository URL as well as the branch to edit. {{/if}} ``` + +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 + + {{#if page.relativePath}} + + {{/if}} + +``` + +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.