Skip to content

Commit 7265f43

Browse files
TMHSDigitalclaude
andcommitted
credits: one placeholder syntax, enforced, and flagged wherever a line is copied
Templated credit lines mixed "Song Name", "[Font name]", "<family>", "MM/YYYY" and "{author}", and the copy buttons and CREDITS export passed them on unmarked. Fields are now written {name} only (V35 rejects the other styles), highlighted on entry and stack pages, named in the copy status, and called out at the top of "Copy all credits" and in the CREDITS export. Seven entries converted; CONTRIBUTING and site/README document the syntax. Closes #172 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXRUqm7oDedPDk3QWtK
1 parent cea8055 commit 7265f43

18 files changed

Lines changed: 135 additions & 20 deletions

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To add a starter stack (one pick per need for a kind of game), follow [`stacks/R
4949
- `license_spdx`: the SPDX identifier the vocabulary maps your `license` to. The validator rejects a missing one when a mapping exists, and an invented one when it does not.
5050
- `commercial`: `true` / `false` / `unknown` / `varies`. Use `varies` for aggregators where some files are commercial-ok and others are not. The site still shows these under Commercial OK, labeled **per-file review**, so they are not silently excluded and not silently treated as a blanket grant.
5151
- `attribution_required`: `true` / `false` / `unknown`. If the licence normally requires credit (CC-BY) but the publisher waives it, set `false` and add a `- Attribution waived:` line in Notes saying so.
52-
- `attribution_string`: the copy-paste credit line. Required when `attribution_required` is `true`; optional otherwise.
52+
- `attribution_string`: the copy-paste credit line. Required when `attribution_required` is `true`; optional otherwise. Where the source's line is a template, mark each part the reader fills in with braces, as `"{title}" by Kevin MacLeod`; the site highlights `{…}` fields, and the copy buttons and CREDITS export tell the reader to fill them in. Other styles (`[Font name]`, `<family>`, a bare `MM/YYYY`, `(sound page URL)`) are rejected (V35), since they would be copied into a game unmarked.
5353
- `publisher`: optional. Name the **rights-holding publisher**, never the host. Set it whenever that publisher has more than one catalog entry, so each entry page names the same publisher and the validator can check that the group agrees; setting it on a publisher that currently has only one entry is also fine and saves a backfill later. Do not set it to a generic host or distributor (GitHub, Hugging Face, itch.io, OpenGameArt, the Internet Archive, Google Fonts) or to a distributor that does not hold the rights. Distinguish sibling organisations that are genuinely different rights holders: `blender.md` (the application, Blender Foundation) carries no `publisher`, while the asset bundles under `studio.blender.org` carry `Blender Studio`. Kenney, Quaternius, KayKit, LuizMelo, 0x72, Blender Studio, Material Maker, Alif Type, GGBotNet and 3dmodelscc0 are the largest groups in use today; treat that as illustrative, not as the permitted set.
5454
- `subcategories`: lower-case kebab-case (`base-meshes`, `field-recordings`). Reuse a value already in the catalog before inventing one, and do not add a variant of an existing value that differs only in plural or spelling. Where both forms were in use, the more common one was kept (`characters`, `environment`, `interior`, `tileset`, `vectors`, `pixel`, `impulse-responses`, `base-meshes`). Retired spellings are listed in [`site/value-aliases.json`](site/value-aliases.json), which the validator enforces (V19); add a line there when you merge two values.
5555
- `formats`: what you actually get, in one of four kinds. **File formats**, as commonly written: usually upper case (`PNG`, `FBX`, `JSON`, `VOX`), tool-specific ones as the tool writes them (`gdshader`, `tmx`, `ktx2`). **Engine or language targets**, as the product writes them (`glTF`, `Godot`, `Unity`, `Python`, `React`). **Delivery types** for software with no file format of its own, lower-case kebab-case (`godot-addon`, `blender-extension`, `npm`, `cli`, `library`, `desktop-app`, `mobile-app`, `middleware`, `model`). And `various` for an aggregator whose files come in too many formats to list. Platforms (`windows`, `macos`, `ios`) and descriptions (`heightfield`, `examples`) are `tags`, not formats. The allowed values are the closed list in [`site/format-vocabulary.json`](site/format-vocabulary.json), which the validator enforces (V20): reuse a listed spelling, and add a genuinely new format there in the same change that first uses it. Its `groups` drive the site's Format filter, so a new format that belongs to a group (another glTF or font container) goes into that group too. A format outside every group is still searchable and shown on the card, but the Format filter cannot select it.

‎catalog/audio/budgetpixel-sfx.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: CC-BY-4.0
88
license_spdx: CC-BY-4.0
99
commercial: true
1010
attribution_required: true
11-
attribution_string: "\"Sound Title\" by BudgetPixel AI (sound page URL), CC BY 4.0"
11+
attribution_string: "\"{sound title}\" by BudgetPixel AI ({sound page URL}), CC BY 4.0"
1212
formats: [WAV, MP3]
1313
tags: [ai-generated, ui, impact, whoosh]
1414
added: 2026-09-30

‎catalog/audio/eric-skiff-resistor-anthems.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: CC-BY-4.0
88
license_spdx: CC-BY-4.0
99
commercial: true
1010
attribution_required: true
11-
attribution_string: "Music: Eric Skiff - Song Name - Resistor Anthems - Available at http://EricSkiff.com/music"
11+
attribution_string: "Music: Eric Skiff - {song name} - Resistor Anthems - Available at http://EricSkiff.com/music"
1212
formats: [MP3]
1313
tags: [chiptune, 8-bit, retro, music, album, credit-required]
1414
added: 2026-09-23

‎catalog/audio/incompetech.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: CC-BY-4.0
88
license_spdx: CC-BY-4.0
99
commercial: true
1010
attribution_required: true
11-
attribution_string: "Title Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 4.0 https://creativecommons.org/licenses/by/4.0/"
11+
attribution_string: "{title} Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 4.0 https://creativecommons.org/licenses/by/4.0/"
1212
formats: [MP3, WAV]
1313
tags: [music, loops]
1414
added: 2026-07-19

‎catalog/environment/nls-finland-elevation-model.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license: CC-BY-4.0
88
license_spdx: CC-BY-4.0
99
commercial: true
1010
attribution_required: true
11-
attribution_string: "Contains data from the National Land Survey of Finland Elevation Model 2 m MM/YYYY"
11+
attribution_string: "Contains data from the National Land Survey of Finland Elevation Model 2 m {MM/YYYY}"
1212
formats: [GeoTIFF, ASCII]
1313
tags: [terrain, government, finland, lidar-derived]
1414
publisher: National Land Survey of Finland

‎catalog/fonts/fontsource.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ commercial: varies
99
attribution_required: true
1010
formats: [TTF, WOFF, WOFF2, npm]
1111
tags: [npm, self-host, aggregator]
12-
attribution_string: "See the OFL.txt / LICENSE in the @fontsource/<family> package you installed"
12+
attribution_string: "See the OFL.txt / LICENSE in the @fontsource/{family} package you installed"
1313
added: 2026-08-24
1414
verified: 2026-08-24
1515
status: active

‎catalog/fonts/velvetyne.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ commercial: true
1010
attribution_required: true
1111
formats: [OTF, TTF, WOFF]
1212
tags: [foundry, libre]
13-
attribution_string: "[Font name] by [designer] / Velvetyne Type Foundry"
13+
attribution_string: "{font name} by {designer} / Velvetyne Type Foundry"
1414
added: 2026-08-24
1515
verified: 2026-08-24
1616
status: active

‎site/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ and tools that want the metadata without scraping the page. The page itself load
4848
The reader-facing guide to the exports is [`docs/data.md`](../docs/data.md).
4949
- Each entry carries its frontmatter fields (`id`, `name`, `url`, `category`,
5050
`subcategories`, `license`, `license_spdx` where set, `commercial`,
51-
`attribution_required`, `attribution_string` where set, `formats`, `tags`, `added`,
51+
`attribution_required`, `attribution_string` where set (a template marks fields as `{name}`;
52+
`lib/owes.mjs` highlights them and flags them on copy and export), `formats`, `tags`, `added`,
5253
`verified`, `status`, `publisher` where set, and, only where set, `maintenance`,
5354
`engine_lock`, `ue_versions` and the 2D fields `grid_dimensions`, `camera_perspective`
5455
and `hardware_tags`), plus `path` (the entry's

‎site/checks.mjs‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,35 @@ export function checkPreviewVocabulary(vocab, allow = PREVIEW_LICENSES, credits
360360
return errors;
361361
}
362362

363+
/* ----------------------------------------------------------------- V35 */
364+
/**
365+
* A templated credit line marks what the reader fills in with braces only:
366+
* `"{title}" by Kevin MacLeod`. The site highlights `{…}` fields and the copy
367+
* buttons and CREDITS export flag them (lib/owes.mjs); any other style
368+
* (`[Font name]`, `<family>`, `MM/YYYY`, `(sound page URL)`) would be copied
369+
* into a game unmarked. A bare word like `Song Name` cannot be told from a
370+
* real title, so reviewers still read the line.
371+
*/
372+
const CREDIT_PLACEHOLDER_STYLES = [
373+
[/\[[^\]]+\]/, "square brackets"],
374+
[/<[A-Za-z][\w -]*>/, "angle brackets"],
375+
[/\b(?:MM|YYYY|YY|DD)\b/, "a date pattern"],
376+
[/\([^)]*\b(?:URL|url|link)\)/, "a parenthesised description"],
377+
];
378+
379+
export function checkCreditPlaceholders(rel, meta) {
380+
const line = meta.attribution_string;
381+
if (typeof line !== "string" || !line) return [];
382+
const errors = [];
383+
const outside = line.replace(/\{[^{}\n]+\}/g, "");
384+
if (/[{}]/.test(outside)) errors.push(`${rel} attribution_string has an unmatched or nested brace; write each field as {name}`);
385+
for (const [re, style] of CREDIT_PLACEHOLDER_STYLES) {
386+
const m = outside.match(re);
387+
if (m) errors.push(`${rel} attribution_string marks "${m[0]}" with ${style}; write a field the reader fills in as {name} (CONTRIBUTING.md)`);
388+
}
389+
return errors;
390+
}
391+
363392
/* ----------------------------------------------------------------- V33 */
364393
/**
365394
* Every frontmatter key an entry may use. An unknown key was ignored without

‎site/checks.test.mjs‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
checkTitleMatchesName,
3939
checkValueAliases,
4040
checkValueSpellings,
41+
checkCreditPlaceholders,
4142
checkKnownKeys,
4243
checkEntryBasics,
4344
checkFeatured,
@@ -899,6 +900,16 @@ rejects("V34 rejects an allowlisted licence missing from the vocabulary", checkP
899900
rejects("V34 rejects a required licence the caption would not credit", checkPreviewVocabulary({ licenses: { "OGA-BY-3.0": { attribution: "required" } } }, ["OGA-BY-3.0"], () => false), "would lack the creator credit");
900901
rejects("V34 rejects a credit on a licence that does not ask for one", checkPreviewVocabulary({ licenses: { MIT: { attribution: "notice" } } }, ["MIT"], () => true), "carry a credit the licence does not ask for");
901902

903+
/* V35: credit-line placeholders use {name} ---------------------------------- */
904+
accepts("V35 accepts {field} placeholders", checkCreditPlaceholders("ok.md", { attribution_string: '"{title}" by Kevin MacLeod ({MM/YYYY})' }));
905+
accepts("V35 accepts an address in angle brackets", checkCreditPlaceholders("ok.md", { attribution_string: "EzSpriteSheet <z64.me>" }));
906+
accepts("V35 ignores a missing line", checkCreditPlaceholders("ok.md", {}));
907+
rejects("V35 rejects square brackets", checkCreditPlaceholders("bad.md", { attribution_string: "[Font name] by X" }), 'marks "[Font name]" with square brackets');
908+
rejects("V35 rejects angle-bracket fields", checkCreditPlaceholders("bad.md", { attribution_string: "@fontsource/<family>" }), "angle brackets");
909+
rejects("V35 rejects a bare date pattern", checkCreditPlaceholders("bad.md", { attribution_string: "Data MM/YYYY" }), "a date pattern");
910+
rejects("V35 rejects a parenthesised description", checkCreditPlaceholders("bad.md", { attribution_string: "By X (sound page URL)" }), "a parenthesised description");
911+
rejects("V35 rejects an unmatched brace", checkCreditPlaceholders("bad.md", { attribution_string: "By {artist" }), "unmatched or nested brace");
912+
902913
/* V33: no unknown frontmatter keys ------------------------------------------ */
903914
accepts("V33 accepts the documented keys", checkKnownKeys("ok.md", { id: "a", engine_lock: "unreal", attribution_string: "x", preview: "none" }));
904915
rejects("V33 rejects a hyphenated key and names the real one", checkKnownKeys("bad.md", { "engine-lock": "unreal" }), 'unknown frontmatter key "engine-lock" (did you mean "engine_lock"?)');

0 commit comments

Comments
 (0)