Skip to content

Commit

Permalink
document the page.fileUri property in the UI model and the role it pl…
Browse files Browse the repository at this point in the history
…ays in the Edit this Page link [skip ci]
  • Loading branch information
mojavelinux committed Sep 1, 2020
1 parent 6592cba commit 650b6a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/modules/ROOT/pages/templates.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ If there's only a single version of the component, the canonical URL is the qual
This value is derived automatically for the hosts github.com, gitlab.com, pagure.io, and bitbucket.org, even if the repository is private.
If the host is not recognized, or you want to customize the value, you can use the `edit_url` key on the content source in the playbook.

The default UI shows an "Edit this Page" link that points to this URL unless the repository is private (i.e., `page.origin.private` is true).
You can force the link to be shown by setting the environment variable `FORCE_SHOW_EDIT_PAGE_LINK` or by customizing the UI template.
The default UI shows an "Edit this Page" link that points to this URL unless the repository is private (i.e., `page.origin.private` is true) or `page.fileUri` is set.
You can force this link to be shown by setting the environment variable `FORCE_SHOW_EDIT_PAGE_LINK` (e.g., `FORCE_SHOW_EDIT_PAGE_LINK=true`) or by customizing the logic in the UI template.

| page.fileUri
| The local file:// URI to edit the current page if the page originates from the local filesystem (i.e., the worktree).

If this property is set, the default UI shows an "Edit this Page" link that points to this URI (instead of the `page.editUrl` value) unless the `CI` environment variable is set (e.g., `CI=true`).
When the `CI` environment variable is set, the default UI ignores this property (since linking to a local file:// URI in a published site doesn't make any sense).

| page.origin.private
| This value will be true if the repository requires authentication or the repository URL embeds credentials.
Expand Down

0 comments on commit 650b6a7

Please sign in to comment.