Generation: classify localized page-category post paths ({lang}/{slug}/index.html) #85
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: Audit section 2.15 (second half). Verify first, then fix.
Context: Page-category posts render at
/{slug}/index.htmlin every language tree (specs/generation.alliumGenerateCoreSectionPages, MultiLanguageRoutes).classify_generated_path(crates/bds-core/src/engine/generation.rs~line 761) maps[slug, "index.html"]→ Core, but for["de", "about", "index.html"]the prefix-stripping helperhas_language_prefixdoesn't fire (second segment is a slug, not one of index.html/404.html/page/year/category/tag), so the 3-segment path falls through to None — excluded from section-scoped validation apply and stale-page cleanup.Task: Write a failing test for
classify_generated_path("de/about/index.html")(expect Core, matching the unprefixed variant), then fix the prefix detection (best solved together with the blogLanguages-driven prefix issue — if the first segment is a configured language, strip it and classify the remainder; beware ambiguity with a page post whose slug equals a language code, mirror whatever bDS2 does in its path classification — see../bDS2/lib/bds/generation.ex).Acceptance: Localized page-post paths classify as Core; validation apply rewrites/cleans them like their main-language counterparts.
Implemented in
556d9c1. Configured language prefixes are now stripped before all generated-route classification, so localized page-category paths such as de/about/index.html classify as Core just like about/index.html. Added a red/green classifier regression plus an end-to-end validation test that repairs a tampered localized page, deletes a stale localized page, and leaves validation clean. Updated README. Neutral review confirmed parity with bDS2 extract_language_path and specs/generation.allium MultiLanguageRoutes/GenerateCoreSectionPages. cargo build --workspace and cargo test --workspace pass.