feat(site): surface a datasets count metric#30
Merged
Conversation
Add datasets.ts: computeDatasetBreakdown sums each page's natural unit — inventory-table rows (species + CrossSpecies), H3 entries (reference pages), and H2 entries (Benchmarks) — to a single 'datasets' total (129). Expose it as counts.datasets and a metrics.datasets breakdown; generate-data asserts the parts sum to the total and match counts.json. metrics.speciesInventory now delegates to the shared inventoryRowCount helper.
Hero stat, the 'Datasets by species' card, and the By the Numbers top stat now show the 129-dataset total instead of the 14 species-page count. The species page count moves to a detail position — the dashboard's per-species breakdown section, with a new caption showing the dataset breakdown by source-page shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a top-line `datasets` count (129) — the number of individual catalogued datasets, not just the 14 dataset pages — and surfaces it across the homepage hero, the "Datasets by species" card, and the "By the Numbers" dashboard, replacing the old "Species / Dataset pages" headline. The species-page count (14) is retained in a detail position on the dashboard.
How the count works
"Datasets" is not one uniform shape in the corpus, so each `Datasets/` page contributes its natural, deterministic unit (no canonical Markdown was changed — the parser accommodates the existing shapes):
A new `datasets.ts` parser module (`computeDatasetBreakdown`) is the single source of truth: `counts.ts` reads its total for `counts.json`, `metrics.ts` reads its breakdown for the dashboard, and `generate-data.ts` asserts the parts sum to the total and match `counts.json` — extending the project's existing "a stat can't drift from the page it links to" invariant. `metrics.speciesInventory` now delegates to the shared `inventoryRowCount` helper.
Changes
Verification
🤖 Generated with Claude Code