From f772839e3542a8e4a8f44569f42fb8339663d434 Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Tue, 15 Sep 2026 11:01:43 +0900 Subject: [PATCH] feat(site): count CPU engineering samples in the homepage stats Reads the satellite repo's published catalog.json and adds its record count as a stat tile; the footer link from #174 is removed. Refs #19 --- site/src/pages/index.astro | 4 +--- site/src/scripts/techapi.js | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/site/src/pages/index.astro b/site/src/pages/index.astro index bc0563c82953..fe6810109e80 100644 --- a/site/src/pages/index.astro +++ b/site/src/pages/index.astro @@ -330,9 +330,7 @@ const endpoints = [ + Playground

⚠ Curated, growing dataset — not yet an exhaustive catalog of every device.

Validated, scored & served by TTechEngine — the open data + scoring engine.

diff --git a/site/src/scripts/techapi.js b/site/src/scripts/techapi.js index b426741bdf9f..71f41edf1735 100644 --- a/site/src/scripts/techapi.js +++ b/site/src/scripts/techapi.js @@ -182,6 +182,15 @@ async function loadList(resource) { // The hero is already in view at first paint. Animate immediately so the // counters do not remain at zero when IntersectionObserver is delayed. el.querySelectorAll(".num").forEach((n) => countUp(n, +n.dataset.n)); + // Satellite data repos publish their own catalog; count them alongside. + fetch("https://gettechapi.github.io/cpu-engineering-samples/catalog.json") + .then((r) => (r.ok ? r.json() : Promise.reject())) + .then((list) => { + el.insertAdjacentHTML("beforeend", + `
0
cpu eng. samples
`); + countUp(el.lastElementChild.querySelector(".num"), list.length); + }) + .catch(() => {}); }).catch(() => { el.innerHTML = '
build data first
'; });