This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 9cdffb9a81 fix switching versions in docs (#283)
9cdffb9a81 is described below

commit 9cdffb9a817783f5143456ed828d0253e06cd9ad
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Mon Sep 14 18:14:50 2026 +0200

    fix switching versions in docs (#283)
---
 ui/css/site.css               | 1 +
 ui/partials/explore-group.hbs | 8 +++++---
 ui/partials/nav-footer.hbs    | 7 +++++--
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ui/css/site.css b/ui/css/site.css
index 75407bfb2a..2106ad21bd 100644
--- a/ui/css/site.css
+++ b/ui/css/site.css
@@ -456,6 +456,7 @@
 }
 .explore__body a:hover { background: var(--surface-2); color: var(--ink); }
 .explore__body .is-current > a { color: var(--accent); font-weight: 600; 
background: var(--surface-2); }
+.explore__body .is-missing > a { color: var(--ink-3); font-style: italic; }
 
 .nav-foot__edit {
   display: flex; align-items: center; gap: 7px; margin-top: 10px;
diff --git a/ui/partials/explore-group.hbs b/ui/partials/explore-group.hbs
index 82a5e1fbfc..d50b38f6c9 100644
--- a/ui/partials/explore-group.hbs
+++ b/ui/partials/explore-group.hbs
@@ -15,13 +15,15 @@
     limitations under the License.
 }}
 {{! One manual and its versions. Rendered from nav-footer twice: once for the
-    manual you are reading, then once per other manual. }}
+    manual you are reading (current=true, versions=page.versions so each link
+    lands on the same page in that version), then once per other manual
+    (versions=component.versions, so each link lands on the version's start 
page). }}
 <div class="explore__group">
   <p class="explore__title">{{{title}}}</p>
   <ul>
     {{#each versions}}
-    <li class="{{#if (and (eq .. @root.page.component) (eq this 
@root.page.componentVersion))}}is-current{{/if}}">
-      <a href="{{{relativize ./url}}}">{{./displayVersion}}</a>
+    <li{{#if (and ../current (eq ./version 
@root.page.componentVersion.version))}} class="is-current"{{else if ./missing}} 
class="is-missing"{{/if}}>
+      <a href="{{{relativize ./url}}}"{{#if ./missing}} title="This page does 
not exist in {{./displayVersion}}; opens the start 
page"{{/if}}>{{./displayVersion}}</a>
     </li>
     {{/each}}
   </ul>
diff --git a/ui/partials/nav-footer.hbs b/ui/partials/nav-footer.hbs
index 48e8b3cd37..ae7aea9098 100644
--- a/ui/partials/nav-footer.hbs
+++ b/ui/partials/nav-footer.hbs
@@ -27,8 +27,11 @@
       <svg class="explore__chev" width="10" height="10" viewBox="0 0 10 10" 
aria-hidden="true"><path d="M1 3l4 4 4-4" fill="none" stroke="currentColor" 
stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
     </summary>
     <div class="explore__body">
-      {{! The manual you are reading comes first, then the rest. }}
-      {{#with page.component}}{{> explore-group}}{{/with}}
+      {{! The manual you are reading comes first, then the rest. For it, link 
each
+          version to *this page* in that version (page.versions), so switching
+          versions keeps you on the page you were reading; Antora points an 
entry
+          at the version's start page, flagged missing, when the page is not 
there. }}
+      {{#with page.component}}{{> explore-group [email protected] 
current=true}}{{/with}}
       {{#each site.components}}
         {{#unless (eq this @root.page.component)}}{{> 
explore-group}}{{/unless}}
       {{/each}}

Reply via email to