From 29fb75715368385e32a48340e940032a512d6ad1 Mon Sep 17 00:00:00 2001 From: AshwaSC Date: Sun, 2 Aug 2026 13:59:14 +0530 Subject: [PATCH] fix: homepage catalogue counts derive from single source of truth The homepage carried its own duplicated `catalogProjects` array plus two hardcoded "Projects" numbers, so counts never updated when the real catalogue (/catalog/catalog-data.js) changed. They had already drifted: the stats-bar "Projects" read 51, the preview card read 48, while the source of truth has 53 entries. Changes: - Load /catalog/catalog-data.js on the homepage and derive `catalogProjects` from window.CATALOG_PROJECTS (the single source of truth shared with the catalogue page and admin). - Remove the duplicated inline project array; keep only a curated id->image lookup for showcase visuals, with a theme-icon fallback for entries that have no curated image (e.g. new projects 52 & 53). - Set #catalogCount and #statProjects from catalogProjects.length up front (no network dependency), so both always match the catalogue. - Replace the hardcoded "48" with a "-" placeholder, consistent with the stats bar, so no count is baked into the markup. Note: the "Delivered by 15 climate projects" line is an editorial impact claim (not a catalogue total) and is intentionally left unchanged; it has no derivable source field yet. Verified in headless Chrome: #catalogCount and #statProjects both render 53, carousel renders 6 slides, no console errors. Co-Authored-By: Claude Opus 4.8 (1M context) --- website/public/index.html | 145 +++++++++++++++++++++++--------------- 1 file changed, 90 insertions(+), 55 deletions(-) diff --git a/website/public/index.html b/website/public/index.html index 9a745bf3..01aa7b68 100644 --- a/website/public/index.html +++ b/website/public/index.html @@ -168,7 +168,7 @@

What is Neighbourhoods of the Future?
Catalogue - 48 Projects + - Projects Browse all