Skip to content

Commit a529535

Browse files
committed
update UI to leverage features in Antora 3
- switch back to built-in canonical URL (page.canonicalUrl) - switch back to built-in latest page (page.latest) - don't show View Latest button if page does not exist in latest version - minor formatting
1 parent 01b78e2 commit a529535

File tree

6 files changed

+15
-79
lines changed

6 files changed

+15
-79
lines changed

src/helpers/canonical-url.js

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

src/helpers/latest-page-url.js

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

src/layouts/default.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
{{> head-first}}
55
<title>{{{detag (or page.title 'Untitled')}}}{{#with site.title}} | {{this}}{{/with}}</title>
6-
{{#with (canonical-url)}}
6+
{{#with page.canonicalUrl}}
77
<link rel="canonical" href="{{this}}">
88
{{/with}}
99
{{> head-last}}

src/layouts/tutorials.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
{{> head-first}}
55
<title>Tutorials{{#with site.title}} | {{this}}{{/with}}</title>
6-
{{#with (canonical-url)}}
6+
{{#with page.canonicalUrl}}
77
<link rel="canonical" href="{{this}}">
88
{{/with}}
99
{{> head-last}}

src/partials/main.hbs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
<main class="article" data-ceiling="topbar">
22
{{#unless (or (ne page.attributes.hide-view-latest undefined) (eq page.componentVersion page.component.latest))}}
3-
{{#with (latest-page-url)}}
3+
{{#with page.latest}}
4+
{{#if ./missing}}
5+
{{#if (and @root.page.componentVersion.prerelease (not ./prerelease))}}
46
<div class="article-banner">
5-
{{#if (and @root.page.componentVersion.prerelease (not @root.page.latest.prerelease))}}
6-
<i class="fas fa-file-alt"></i> <p> You are viewing the documentation for a prerelease version.</p>
7-
{{else}}
8-
<i class="fas fa-file-alt"></i> <p> A newer version of this documentation is available.</p>
9-
{{/if}}
10-
<a class="btn" href="{{relativize this}}">View Latest</a>
7+
<i class="fas fa-file-alt"></i> <p>You are viewing the documentation for a prerelease version.</p>
118
</div>
12-
{{else if (and page.componentVersion.prerelease (not page.latest.prerelease))}}
9+
{{/if}}
10+
{{else}}
1311
<div class="article-banner">
12+
{{#if (and @root.page.componentVersion.prerelease (not ./prerelease))}}
1413
<i class="fas fa-file-alt"></i> <p>You are viewing the documentation for a prerelease version.</p>
14+
{{else}}
15+
<i class="fas fa-file-alt"></i> <p>A newer version of this documentation is available.</p>
16+
{{/if}}
17+
<a class="btn" href="{{relativize ./url}}">View Latest</a>
1518
</div>
19+
{{/if}}
1620
{{/with}}
1721
{{/unless}}
1822
<div class="article-header">

src/partials/nav-version-control.hbs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
<ul class="frame-dropdown-list">
2020
{{#each page.versions}}
2121
{{#unless (eq ./version @root.page.version)}}
22-
<li><a class="frame-item" href="{{relativize ./url}}">
23-
{{!-- {{{@root.page.component.title}}} --}}
24-
{{./displayVersion}}</a></li>
22+
<li><a class="frame-item" href="{{relativize ./url}}">{{./displayVersion}}</a></li>
2523
{{/unless}}
2624
{{/each}}
2725
</ul>

0 commit comments

Comments
 (0)