Skip to content

Commit 0fc311e

Browse files
committed
Dynamically update the total posts count displayed on the blog page.
1 parent 9324292 commit 0fc311e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

blog.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h1>Mit Patel's Blog</h1>
9393
<h2 class="section-heading">
9494
<span style="display: inline-flex; align-items: baseline; gap: 0.5rem;">
9595
Recent Posts
96-
<span
96+
<span id="total-posts-count"
9797
style="font-size: 0.65em; font-weight: 500; opacity: 0.6; text-transform: uppercase; font-style: italic; letter-spacing: 0.5px;">Total
9898
Posts: 12</span>
9999
</span>
@@ -526,6 +526,12 @@ <h2 class="section-heading">Filter by Technology</h2>
526526
} else {
527527
loadMoreBtn.style.display = 'inline-block';
528528
}
529+
530+
// Update total posts counter
531+
const totalPostsEl = document.getElementById('total-posts-count');
532+
if (totalPostsEl) {
533+
totalPostsEl.textContent = 'Total Posts: ' + matchingPosts.length;
534+
}
529535
}
530536

531537
// Sync the visual active state across both filter containers

0 commit comments

Comments
 (0)