From 5ee5bf85e47e147ddd22627532dc138bc7935a98 Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 25 May 2025 21:14:53 +0200 Subject: [PATCH] feat: implement tabbed category filtering for content list page --- layouts/_default/list.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index db15491..18a65c3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -83,7 +83,16 @@ document.addEventListener('DOMContentLoaded', function() { visibleCount++; } else { const cardCategory = cardDiv.getAttribute('data-category'); // Get category from the .card div - console.log('Card element:', cardLinkElement, 'Card div:', cardDiv, 'Card category:', cardCategory, 'Selected:', selectedCategory); + + // Detailed log for comparison + const sCat = selectedCategory ? selectedCategory : 'null_or_empty'; + const cCat = cardCategory ? cardCategory : 'null_or_empty'; + console.log( + `Comparing: cardCategory='${cCat}' (length ${cCat.length})` + + ` vs selectedCategory='${sCat}' (length ${sCat.length})` + + ` for card titled: '${cardDiv.querySelector('.card-title') ? cardDiv.querySelector('.card-title').textContent.trim() : 'N/A'}'` + ); + const isVisible = (cardCategory === selectedCategory); cardLinkElement.style.display = isVisible ? '' : 'none'; if (isVisible) visibleCount++;