From ed6c2c1611b59a0b1cd19d01345e88848877c5dd Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:16:35 +0200 Subject: [PATCH] feat: provide link to related latest page for "out of support" pages 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. --- README.adoc | 2 +- preview-src/ui-model.yml | 2 ++ src/partials/toolbar.hbs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 733c9605..619f0598 100644 --- a/README.adoc +++ b/README.adoc @@ -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`. diff --git a/preview-src/ui-model.yml b/preview-src/ui-model.yml index 7ec1e987..bcfcd5ec 100644 --- a/preview-src/ui-model.yml +++ b/preview-src/ui-model.yml @@ -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' diff --git a/src/partials/toolbar.hbs b/src/partials/toolbar.hbs index 42496ac0..ab00a40d 100644 --- a/src/partials/toolbar.hbs +++ b/src/partials/toolbar.hbs @@ -42,7 +42,7 @@ {{#if page.attributes.out-of-support}}

This documentation is about a version that is out of support, here is the latest documentation + href="{{{relativize page.latest.url}}}">latest documentation version.