mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Fix stars page grouping to keep book items together
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user