From fc8bb7f19728731ff24157ba9ff45ed21aa19ced Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 3 Dec 2025 21:42:51 -0500 Subject: [PATCH] Fix stars page grouping to keep book items together MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Group by first two breadcrumbs (e.g., "Books / 1 Corinthians") so that chapters and verses from the same book appear in the same group instead of being split across different groups. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/templates/stars.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kjvstudy_org/templates/stars.html b/kjvstudy_org/templates/stars.html index d07bf89..e6ade88 100644 --- a/kjvstudy_org/templates/stars.html +++ b/kjvstudy_org/templates/stars.html @@ -851,9 +851,14 @@ kbd { } function getGroupBreadcrumbs(breadcrumbs) { + // Group by the first two meaningful breadcrumbs (e.g., "Books / 1 Corinthians") + // This keeps chapters and verses of the same book together if (!breadcrumbs || breadcrumbs.length === 0) return []; - if (breadcrumbs.length <= 1) return breadcrumbs; - return breadcrumbs.slice(0, -1); + // Filter out "Home" + var filtered = breadcrumbs.filter(function(c) { return c.text !== 'Home'; }); + if (filtered.length === 0) return []; + // Take first two items max (e.g., "Books" + "1 Corinthians") + return filtered.slice(0, 2); } function getBreadcrumbKey(breadcrumbs) {