feat(songs): inject Category:Songs for pages with an album

Pages with a valid `album` field now get [[Category:Songs]] prepended
before [[Category:Album:<name>]]. Companion/sibling pages without an
album are unaffected. Updated SCHEMA.md and pipeline README accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 10:17:22 +09:00
parent db159fd63d
commit 6144d1f399
3 changed files with 8 additions and 7 deletions
+5 -5
View File
@@ -51,11 +51,11 @@ Files under `wip/` are also skipped, regardless of `wiki.publish`.
#### `album` (string)
The full album name. Drives `[[Category:Album:<album name>]]` injection at the bottom of the rendered wiki page.
The full album name. Drives `[[Category:Songs]]` and `[[Category:Album:<album name>]]` injection at the bottom of the rendered wiki page.
Example: `album: Shirakaba Express Service` → category tag `[[Category:Album:Shirakaba Express Service]]`.
Example: `album: Shirakaba Express Service` → category tags `[[Category:Songs]]` and `[[Category:Album:Shirakaba Express Service]]`.
Pages without an album (companion documents, placeholders, songs without an assigned album) simply omit this field — no category is injected unless `categories` provides one.
Pages without an album (companion documents, placeholders, songs without an assigned album) simply omit this field — neither category is injected unless `categories` provides one.
#### `categories` (list of strings)
@@ -139,7 +139,7 @@ For each `.md` with `wiki.publish: true` and not under `wip/`:
4. Substitute `TAG` placeholders with resolved `[[Page|Display]]` wikilinks (or fallback text).
5. Prepend the auto-generated banner: `{{Auto-generated|source=<source URL>|commit=<sha>}}`.
6. If `lrc` is declared: upload the LRC file if its SHA1 has changed; append a `[[Media:…]]` link.
7. Append category tags: `[[Category:Album:<album>]]` if `album` is set; `[[Category:<cat>]]` for each entry in `categories`.
7. Append category tags: `[[Category:Songs]]` and `[[Category:Album:<album>]]` if `album` is set; `[[Category:<cat>]]` for each entry in `categories`.
8. Read the current wiki page content via the MediaWiki API; if identical to the generated output, skip the write (idempotency — keeps the wiki history clean).
9. If the page exists and does not start with `{{Auto-generated`, skip with a warning (manual page protection).
10. Otherwise, write the page with an edit summary referencing the source commit.
@@ -152,7 +152,7 @@ For each `.md` with `wiki.publish: true` and not under `wip/`:
- Banner template injection
- LRC file upload and footer link
- Sibling placeholder resolution (`[[TAG]]``[[wiki page title|label]]`)
- Album category injection (`[[Category:Album:<name>]]`)
- Album category injection (`[[Category:Songs]]` + `[[Category:Album:<name>]]`) when `album` is set
- Additional categories via `categories` list
- Idempotent writes (no-op skip when content matches)
- Manual-page protection (skip pages without auto-gen banner)