Skip to content

Commit

Permalink
feat: provide link to related latest page for "out of support" pages
Browse files Browse the repository at this point in the history
Previously, in the "out of support", the link to the "latest" resource was always targeting the home
page of the latest version of the component.
Now, the link targets the latest version of the current page when it exists.
The template use the "relativize" helper to make the url work with local file browsing

Also update the model-ui used for the preview to demonstrate the change.
  • Loading branch information
tbouffard committed Aug 8, 2024
1 parent 00e2b66 commit ed6c2c1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ When this event is received, a new Pull Request is created in the https://github

== Development

A static or live preview of the theme is available, run `npm run dev`, or `npm run devlive` to unable the live reload. For more details, see the https://docs.antora.org/antora-ui-default/build-preview-ui/[build-preview-ui] documentation. +
A static or live preview of the theme is available, run `npm run dev`, or `npm run devlive` to enable the live reload. For more details, see the https://docs.antora.org/antora-ui-default/build-preview-ui/[build-preview-ui] documentation. +
⚠️ Note that the live reload does not always work, so use it with caution. A restart of the browser, or running `npx browserslist@latest --update-db` when asked may help.

To build the bundle to be used in the Antora playbook, run `npm run bundle`.
Expand Down
2 changes: 2 additions & 0 deletions preview-src/ui-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ page:
editUrl: https://example.com/project-bonita/edit/master/index.adoc
origin:
private: false
latest:
url: /bonita/latest/my-page.html
previous:
content: Cards
url: '/bonita/dev/cards.html'
Expand Down
2 changes: 1 addition & 1 deletion src/partials/toolbar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
{{#if page.attributes.out-of-support}}
<div class="paragraph message-block out-of-support-block">
<p>This documentation is about a version that is <b>out of support</b>, here is the <a
href="{{{page.component.latest.url}}}">latest documentation
href="{{{relativize page.latest.url}}}">latest documentation
version</a>.
</p>
<p>
Expand Down

0 comments on commit ed6c2c1

Please sign in to comment.