Skip to content

Commit 24b339b

Browse files
committed
derive edit URL from properties in Antora 2.3 UI model instead of using helper; add not helper
1 parent 56f0d4a commit 24b339b

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

src/helpers/home-edit-url.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/helpers/not.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
3+
module.exports = (val) => !val

src/partials/toolbar.hbs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
{{#if page.editUrl}}
2-
{{#if (eq page.component.name 'home')}}
1+
{{#with (or (and (not env.CI) page.fileUri) (and (not page.origin.private) page.editUrl))}}
32
<div class="tools" role="navigation">
43
<ul>
5-
<li class="tool edit"><a href="{{home-edit-url page.editUrl 'https://github.com/couchbase/docs-site' page.origin.branch}}" title="Edit Page" target="_blank" rel="noopener">Edit on GitHub</a></li>
4+
<li class="tool edit"><a href="{{this}}" title="Edit Page" target="_blank" rel="noopener">Edit</a></li>
65
</ul>
76
</div>
8-
{{else}}
9-
{{#unless (and (or page.origin.private (includes page.origin.url '@')) (ne page.origin.worktree true))}}
10-
<div class="tools" role="navigation">
11-
<ul>
12-
<li class="tool edit"><a href="{{page.editUrl}}" title="Edit Page" target="_blank" rel="noopener">Edit on GitHub</a></li>
13-
</ul>
14-
</div>
15-
{{/unless}}
16-
{{/if}}
17-
{{/if}}
7+
{{/with}}

0 commit comments

Comments
 (0)