Skip to content

Commit 4adb944

Browse files
TMHSDigitalclaude
andcommitted
counts: one listed-source number everywhere; retake the README screenshot
The README badge and links said 418 sources while the screenshot under them (docs/images/readme/og-card.png, also the social card) still showed "416 free game assets" and "414 of 414 licences" from 2026-10-23. It is retaken from the current build: 418 and 418 of 418. The site disagreed with itself too: the hero said 418 while every page footer said "Built ... from 421 catalog entries" and the catalog said "418 of 421 entries shown". The 421 includes the 3 deprecated entries, which are hidden by default. Footers now count listed sources (418), and the result line counts deprecated entries only once their switch is on, so the default view reads "418 of 418 sources shown". npm run counts now reminds you to retake the screenshot when the count changes, and site/README.md gives the steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXQPaUhxjgqdqnk6BrJ
1 parent a3cd8b0 commit 4adb944

7 files changed

Lines changed: 26 additions & 12 deletions

File tree

‎docs/images/readme/og-card.png‎

-6.01 KB
Loading

‎site/README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,10 @@ with `node site/reverify-batch.mjs` (`npm run reverify`).
194194
## Social preview
195195

196196
`docs/images/readme/og-card.png` is a 1200x630 screenshot of this site's first screen.
197-
`build.mjs` copies it into `dist` and emits the `og:image` and `twitter:image` tags.
198-
Retake it when the hero changes.
197+
`build.mjs` copies it into `dist` and emits the `og:image` and `twitter:image` tags. The
198+
README shows it too, and the hero states the entry count, so retake it whenever that count
199+
changes (`npm run counts` reminds you) or the hero changes: `npm run build && npm run serve`,
200+
then capture the top 1200x630 of `http://127.0.0.1:3000/` in light mode, with no scrollbar.
199201

200202
## Commands
201203

‎site/build.mjs‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ function writeStackPages({ stacks, entries, config, stats, stamp, hasCard, now }
393393
owed: owes(stack.picked),
394394
site: config.site,
395395
stamp,
396-
total: stats.total,
396+
total: stats.total - stats.deprecated,
397397
hasCard,
398398
now,
399399
});
@@ -445,7 +445,7 @@ function writeEntryPages({ entries, bodies, config, stats, stamp, hasCard, now,
445445
site: config.site,
446446
categoryLabel: config.categories[entry.category]?.label || entry.category,
447447
stamp,
448-
total: stats.total,
448+
total: stats.total - stats.deprecated,
449449
hasCard,
450450
now,
451451
stacks: usedIn.get(entry.id) || [],
@@ -468,7 +468,7 @@ function writeCategoryPages({ entries, config, stats, stamp, hasCard, now }) {
468468
if (!group.length) continue;
469469
writeOut(
470470
path.join("category", cat, "index.html"),
471-
categoryPageHtml({ cat, meta, entries: group, site: config.site, stamp, total: stats.total, hasCard, now })
471+
categoryPageHtml({ cat, meta, entries: group, site: config.site, stamp, total: stats.total - stats.deprecated, hasCard, now })
472472
);
473473
written.push(`category/${cat}/index.html`);
474474
}
@@ -511,7 +511,7 @@ function writeGuidePages({ entries, config, stats, stamp, hasCard, modified = ne
511511
// anything else is a bug in the build and stops it, as for entry pages.
512512
try {
513513
const rendered = renderGuide(fs.readFileSync(source, "utf8"), { file: guide.path, resolveLink });
514-
writeOut(path.join("guide", guide.id, "index.html"), guidePageHtml({ guide, rendered, site: config.site, stamp, total: stats.total, hasCard, modified: modified.get(guide.path) || null }));
514+
writeOut(path.join("guide", guide.id, "index.html"), guidePageHtml({ guide, rendered, site: config.site, stamp, total: stats.total - stats.deprecated, hasCard, modified: modified.get(guide.path) || null }));
515515
written.push(`guide/${guide.id}/index.html`);
516516
} catch (err) {
517517
if (!(err instanceof MarkdownError || err instanceof LinkError)) throw err;
@@ -680,10 +680,11 @@ function main() {
680680
CATEGORY_CHIPS: categoryChipsHtml(visible, config.categories),
681681
GUIDE_ROWS: guideRowsHtml(config.guides, repoUrl),
682682
CATALOG_BLURB: `${visible.length} sources &middot; ${stats.active} active &middot; ${stats.commercialOk} commercial-ok &middot; ${stats.commercialVaries} per-file${stats.deprecated ? ` &middot; plus ${stats.deprecated} deprecated, hidden by default` : ""}`,
683-
RESULT_COUNT: `${visible.length} of ${stats.total} entries shown`,
683+
// Deprecated entries are hidden until their switch is on, so they are not counted until then (app.js does the same).
684+
RESULT_COUNT: `${visible.length} of ${stats.total - stats.deprecated} sources shown`,
684685
SPONSOR_BUTTON: sponsorButtonHtml(),
685686
PREVIEW_CREDIT: PREVIEW_CREDIT_LINE,
686-
FOOTER_STAMP: `Built ${esc(stamp)} from ${stats.total} catalog entries.`,
687+
FOOTER_STAMP: `Built ${esc(stamp)} from ${stats.total - stats.deprecated} listed sources.`,
687688
};
688689
let html = fs.readFileSync(path.join(PUBLIC, "index.html"), "utf8");
689690
const missingMarkers = Object.keys(substitutions).filter((key) => !html.includes(`<!--${key}-->`));
@@ -705,7 +706,7 @@ function main() {
705706
writeOut("robots.txt", robotsTxt(config.site));
706707
writeOut("opensearch.xml", opensearchXml(config.site));
707708
writeOut("404.html", notFoundHtml(config.site));
708-
writeOut(path.join("freshness", "index.html"), freshnessPageHtml({ stats: fresh, site: config.site, stamp, total: stats.total, hasCard }));
709+
writeOut(path.join("freshness", "index.html"), freshnessPageHtml({ stats: fresh, site: config.site, stamp, total: stats.total - stats.deprecated, hasCard }));
709710

710711
const pages = writeEntryPages({ entries, bodies, config, stats, stamp, hasCard, now, usedIn });
711712
const stackPages = writeStackPages({ stacks, entries, config, stats, stamp, hasCard, now });

‎site/lib/lib.test.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ eq("search: q from the URL is capped", readState(`?q=${"a".repeat(5000)}`, { q:
17581758
const foot = siteFooterHtml({ root: "../../", stamp: "2026-11-03", total: 7 });
17591759
for (const href of ["freshness/", "data.json", "catalog.csv", "feed.xml", "guide/data/"]) has(`chrome: footer links ${href}`, foot, `href="../../${href}"`);
17601760
has("chrome: footer carries the preview credit", foot, credit);
1761-
has("chrome: footer stamp", foot, "Built 2026-11-03 from 7 catalog entries.");
1761+
has("chrome: footer stamp", foot, "Built 2026-11-03 from 7 listed sources.");
17621762
lacks("chrome: credit: false drops the preview credit", siteFooterHtml({ root: "../../", stamp: "s", total: 1, credit: false }), credit);
17631763
const fresh = siteFooterHtml({ root: "../", stamp: "s", total: 1, current: "freshness" });
17641764
lacks("chrome: the freshness page does not link to itself", fresh, "freshness/");

‎site/lib/shared.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export function siteFooterHtml({ root, stamp, total, credit = true, current = nu
265265
<p>Catalog metadata is CC0. Linked assets keep their own licences. This is the catalog's reading of each licence, not legal advice: re-check the live source before shipping.</p>
266266
${credit ? ` <p class="footer-credit">${PREVIEW_CREDIT_LINE}</p>\n` : ""} <p>${links.join(" · ")}</p>
267267
<p class="footer-sponsor">${sponsorButtonHtml()}</p>
268-
<p class="footer-stamp">Built ${esc(stamp)} from ${total} catalog entries.</p>
268+
<p class="footer-stamp">Built ${esc(stamp)} from ${total} listed sources.</p>
269269
</footer>`;
270270
}
271271

‎site/public/app.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ import { PERSPECTIVES } from "./shared.mjs";
392392
const grid = $("#entry-grid");
393393
const empty = $("#empty-state");
394394
const group = shouldGroup();
395-
$("#result-count").textContent = `${list.length} of ${data.entries.length} entries shown`;
395+
// The denominator is what the status switches could show: deprecated
396+
// entries count only once their switch is on, so the default view reads
397+
// "418 of 418", matching the hero and the README.
398+
const pool = state.deprecated ? data.entries.length : data.entries.filter((e) => e.status !== "deprecated").length;
399+
$("#result-count").textContent = `${list.length} of ${pool} sources shown`;
396400
empty.hidden = list.length > 0;
397401
renderSuggestions(list.length ? "" : state.q);
398402
if (!list.length) {

‎site/sync-counts.mjs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
2323
const ROOT = path.resolve(__dirname, "..");
2424
const CATALOG = path.join(ROOT, "catalog");
2525

26+
let changed = false;
2627
function update(file, fn) {
2728
const full = path.join(ROOT, file);
2829
const before = fs.readFileSync(full, "utf8");
2930
const after = fn(before);
3031
if (after !== before) {
3132
fs.writeFileSync(full, after);
33+
changed = true;
3234
console.log(`updated ${file}`);
3335
}
3436
}
@@ -40,3 +42,8 @@ update("catalog/README.md", (t) => syncCatalogReadme(t, counts));
4042
update("site/config.json", (t) => syncConfig(t, files));
4143

4244
console.log(`${total} listed entries (${files} files, ${deprecated} deprecated): ${Object.entries(counts).map(([c, n]) => `${c} ${n}`).join(", ")}`);
45+
// The README screenshot (also the social card) shows the count as an image,
46+
// which no script can update.
47+
if (changed) {
48+
console.log("The count changed: retake docs/images/readme/og-card.png after the next build (site/README.md, \"Social preview\").");
49+
}

0 commit comments

Comments
 (0)