fix(astro): rename slug to ref to fix Starlight routing#8092
Merged
Conversation
…ht routing Starlight hijacks the frontmatter `slug` field as a route override, causing items like /alchemist-stardust/ instead of /itemdb/alchemist-stardust/. Rename the proto field to `ref` throughout the chain: proto definitions, generated Zod schemas, all 153 MDX frontmatter entries, API route handlers, content config validation, and the discordsh itemdb data file. OSRS slug fields are unchanged (separate system).
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Update prost-generated proto structs (Item, Npc, Quest, QuestChain, Zone, Region, WorldObjectDef, PointOfInterest) and all registry/json code that accesses the field. Methods renamed: from_slug->from_ref, get_by_slug->get_by_ref, id_for_slug->id_for_ref. Also update axum-kbve profile.rs JSON key fallback.
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
slugas a route override, causing items to render at/<name>/instead of/itemdb/<name>/slug->refacross the full chain:Test plan
https://kbve.com/itemdb/alchemist-stardust/resolves correctlyhttps://kbve.com/alchemist-stardust/no longer exists (404)/api/itemdb.jsonreturnsrefinstead ofslug