Problem
Plans are special-cased throughout the codebase: PlanGrid groups by topic, PlanCard renders a nested list of plans per topic, and both page routes branch on collection === "plans". This creates a different UX from every other collection and makes pagination incorrect — PAGE_SIZE operates on individual plans but the display groups them, so a page of 30 plans might show only 5 topic cards.
Design
1. Schema changes
Remove plan-specific fields planType and topic. Add a generic subcategory field available to all collections.
Before:
planType: z.enum(["design", "implementation"]).optional(),topic: z.string().optional(),After:
subcategory: z.string().optional(),2. Frontmatter migration (97 plan files)
For each plan .md file:
- Remove
planTypefield; add its value (designorimplementation) to thetagsarray - Rename
topic→subcategory
Before:
planType: implementationtopic: collection-paginationcategory: layouttags: []After:
subcategory: collection-paginationcategory: layouttags: [implementation]3. Card display
- Plans switch from
cardVariant: "plan"tocardVariant: "compact"(same as recipes) - CompactCard gains an optional
subcategoryline between category and date planTypevalues now appear naturally via CardTags since they’re in the tags array
4. Remove plan-specific code
- Delete
PlanGrid.astro - Delete
PlanCard.astro - Remove
collection === "plans"branches from[collection]/[...page].astroand[collection]/[category]/[...page].astro - Remove
"plan"fromCardVarianttype - Remove
planfallback line fromCard.astro
5. NavItem type
- Add optional
subcategory: stringfield - Remove
topicandplanTypefields
6. Future work (not in this change)
- Subcategory filter UI on collection pages
- Add
subcategoryto other collections