From 141d8dacdde30e86c6d10b2a58ea54328d6a722a Mon Sep 17 00:00:00 2001 From: Thomas Jung Date: Sat, 5 Sep 2026 20:37:26 -0400 Subject: [PATCH] =?UTF-8?q?fix(channels):=20health=20stats=20data=20key=20?= =?UTF-8?q?=E2=80=94=20write=20channels=5Fstats.json=20(underscore)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hugo does not convert hyphens to underscores in data filenames (the Phase 1 plan's premise was wrong). fetch-channels-stats.ts wrote channels-stats.json but the health layout reads .Site.Data.channels_stats, so the key never resolved and the page baked {} → 'Total channels: 0'. Rename the output to channels_stats.json, matching the sibling convention (channel_collections.json, verb_definitions.json). Layout unchanged. Verified: baked stats now total=236. --- hugo/data/.gitignore | 2 +- scripts/fetch-channels-stats.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hugo/data/.gitignore b/hugo/data/.gitignore index 7fa0752e6..72ab49342 100644 --- a/hugo/data/.gitignore +++ b/hugo/data/.gitignore @@ -1,3 +1,3 @@ browse.json author_index.json -channels-stats.json +channels_stats.json diff --git a/scripts/fetch-channels-stats.ts b/scripts/fetch-channels-stats.ts index f9d9d3d2d..1cbebc53a 100644 --- a/scripts/fetch-channels-stats.ts +++ b/scripts/fetch-channels-stats.ts @@ -2,7 +2,10 @@ import { mkdirSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; const CAP_BASE = process.env.CAP_BASE_URL || 'http://localhost:4004'; -const OUT_PATH = join('hugo', 'data', 'channels-stats.json'); +// Underscore filename: Hugo exposes data files under their literal basename +// (no hyphen→underscore conversion), and the health layout reads +// `.Site.Data.channels_stats`. Matches sibling convention (channel_collections.json). +const OUT_PATH = join('hugo', 'data', 'channels_stats.json'); let payload: { total: number; publishedCount: number;