TKW: link castles, battles, and events from prose bodies - #91
Merged
Merged
Conversation
- `EventSchema` gains `aliases` and `mentions`, both defaulting to `[]` - `lib/content-integrity.ts` validates `events.mentions` like `battles.mentions` - `lib/timeline.test.ts` event fixture carries the two new fields
- `buildProseLinkIndex` takes `allCastles`, `allBattles`, `allEvents` and emits `castle`, `battle`, `event` targets
- a name starting with "The" also matches without the article, so "the Twins" and "the Red Wedding" link
- self-suppression and once-per-page dedupe keyed by kind plus slug via `targetKey`
- `ProseLinkIndex.selfSlug` becomes `self: { kind, slug }`
- castles sharing a house's short name (Darry, Rosby, the Hightower) never auto-link; `mentions` cannot tell them apart
- `targetsOf` replaces the four per-kind `flatMap` blocks
- `app/battles/[slug]` and `app/events/[slug]` build a link index and pass `proseLinks` to `renderMarkdown` - character, house, weapon, and dragon pages pass castles, battles, and events into the index
- 57 battles and 29 events list the characters their bodies name by first name only, and the houses named bare - every slug checked against date and sentence; namesake hits (Karstarks as ancient Starks, Sept of Baelor as the king) left out - one character per first name per entry, since the first to register takes the bare name
- `populate-entry` drops the stale "`battles.mentions` does nothing" and "battle bodies never link" rows, adds the `mentions`, alias, and house-named-castle rules, and documents `events.aliases` and `events.mentions` - `audit-orphans.ts` passes castles, battles, and events into `buildProseLinkIndex`, counts battle and event bodies as link sources, and matches the per-kind self rule
✅ Deploy Preview for theknownworld ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- 50 character names are shared by two or more entries, and the first to register kept the surface form regardless of the page - `targetsOf` now orders each kind's entries with the page's `mentions` first, so a page that names the intended entry links to it - unmentioned collisions keep the previous first-wins order
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
mentionsso first names and bare house names linkLinker
buildProseLinkIndextakesallCastles,allBattles,allEventsselfSlugbecomesself: { kind, slug }mentionscarries bare slugsmentionsalso settles a shared name: 50 character names belong to two or more entries, and the one the page lists now wins the surface formSchema and integrity
EventSchemagainsaliasesandmentionsevents.mentionsvalidated likebattles.mentionsContent
mentionscurated per entry against date and sentence; namesake hits left outTooling
populate-entryskill rewritten for the new linking rulesaudit-orphans.tsupdated to the new signature and counts battle and event bodies as link sourcesVerification
lib/prose-links.test.ts,lib/schemas.test.ts,lib/content-integrity.test.tsbun run checkandbun run buildpass; built pages show dragon, castle, and battle links