Repository navigation
refactor(types,web): migrate usc_title to string for alphanumeric titles and appendices - #283
Merged
Merged
Conversation
…les and appendices Support alphanumeric title keys (such as 18a, 5a, 26a) and appendices across transformer frontmatter, Astro collections, routes, and natural collation. Closes #278
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.
Description
Migrates
usc_titleto support string values throughout the transformer frontmatter, Astro content collection schema, routing, and UI presentation. This ensures titles with letter suffixes (such as Title 18 Appendix18a,5a,26a, etc.) are preserved without numeric truncation or collision.Key Changes
FrontmatterSchemainpackages/transformer/src/markdown-generator.tsto acceptz.union([z.string().min(1), z.number().int().positive()]).transform(String).generateFrontmatteroutputs numbers for pure numeric titles and quoted strings for alphanumeric titles.generateMarkdownForSectionpreservestitleNumas a trimmed string instead of forcingparseInt.apps/web/src/content.config.tsto acceptstring | numbertransformed to string.browse/[title].astroandstatute/[...slug].astroto support string keys.TITLE_NAMESinapps/web/src/data/title-names.ts.browse/index.astroto uselocaleComparewith numeric collation.Closes #278