From 672a7a1d7b942009ebf62d3fecb86925888f1981 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 30 Nov 2025 00:27:59 -0500 Subject: [PATCH] Add section title links to keyboard navigation on resource index pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Resource entry titles (h3.resource-name) are now selectable - Enter on a title navigates to the detail page - Allows drill-down navigation: section title -> paragraphs -> verses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/templates/resource_index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kjvstudy_org/templates/resource_index.html b/kjvstudy_org/templates/resource_index.html index d4a6a09..b87933f 100644 --- a/kjvstudy_org/templates/resource_index.html +++ b/kjvstudy_org/templates/resource_index.html @@ -301,7 +301,8 @@ document.addEventListener('DOMContentLoaded', function() { // Two-section navigation: TOC block -> content elements // Or when inside TOC: individual TOC entries - const contentElements = Array.from(document.querySelectorAll('.intro-text, .resource-item-description p, .verse-item')); + // Content elements include section titles (h3 with links), paragraphs, and verse items + const contentElements = Array.from(document.querySelectorAll('.intro-text, .resource-name, .resource-item-description p, .verse-item')); const tocItems = Array.from(tocList.querySelectorAll('li a')); let currentSection = 'content'; // 'content' or 'toc' @@ -420,7 +421,8 @@ document.addEventListener('DOMContentLoaded', function() { if (href) window.location.href = href; } else if (selectedIndex >= 0) { var el = contentElements[selectedIndex]; - var link = el.querySelector('.resource-name a') || el.querySelector('.verse-ref a') || el.querySelector('a'); + // Check if the element itself contains a link, or is an h3 with a link inside + var link = el.querySelector('a') || (el.classList.contains('resource-name') && el.querySelector('a')); if (link) window.location.href = link.href; } } else if (e.key === 'Escape') {