From 28639e67c6774477aa32b9ef1995bae2c74c40f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sgeir=20Thor=20Johnson?= Date: Fri, 19 Jun 2026 00:26:26 +0000 Subject: [PATCH] Surface stars today/7d in the GitHub Stars stat card too The live readout was only on the chart title; mirror today + 7d into the top stat card where the headline numbers are, sourced from the same live windows (falls back to series 7d). --- .github/scripts/accumulate-traffic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/accumulate-traffic.py b/.github/scripts/accumulate-traffic.py index 86c30e3..d0ce9a7 100644 --- a/.github/scripts/accumulate-traffic.py +++ b/.github/scripts/accumulate-traffic.py @@ -336,7 +336,13 @@ const statCards = [ { l:'Peak Day', v:fmt(peakView.count), s:peakView.timestamp.slice(0,10) }, { l:'7-Day Trend', v:`${trend>=0?'+':''}${trend}%`, s:fmt(last7)+' vs '+fmt(prev7) }, ]; -if (curStars != null) statCards.splice(2, 0, { l:'GitHub Stars', v:'★ '+fmt(curStars), s: starGain!=null ? `${starGain>=0?'+':''}${fmt(starGain)} last ${starGainDays}d` : ' ' }); +if (curStars != null) { + const tdy = sw ? sw.d1 : null; + const sub = sw + ? `+${fmt(sw.d1)} today · +${fmt(sw.d7)} 7d` + : (starGain!=null ? `${starGain>=0?'+':''}${fmt(starGain)} last ${starGainDays}d` : ' '); + statCards.splice(2, 0, { l:'GitHub Stars', v:'★ '+fmt(curStars), s: sub }); +} document.getElementById('stats').innerHTML = statCards.map(s=>`
${s.l}
${s.v}
${s.s}
${s.t?`
${s.t}
`:''}
`).join('');