fix(build): locale-home .md/.json projections prerender under the prefix dir#30
Merged
Conversation
…fix dir
prerenderOne special-cased only "/" for projection naming; a locale home ("/de", "/zh-cn") got
"${reqPath}.md" = "/de.md", which has no "/" boundary for the locale matcher — the prefix never
stripped and the request routed as a phantom "de.md" slug (a hard 404 on Kura's docs catch-all,
aborting i18n static builds; a silently wrong flat file on apps whose catch-all renders anything).
Locale homes now request "/<locale>/index.md" (strips to "/index.md", the home alias) and emit
"<locale>/index.md", byte-consistent with the root home.
Red on old (de.md phantom emitted, de/index.md missing), green on new; suite 334/334. Found
building the first trilingual Kura static site (model-compose, en/zh-cn/ko: 177 pages).
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.
Found building the first trilingual Kura static site (en/zh-cn/ko, 177 pages): the build aborted at
prerender /zh-cn.md -> 404. prerenderOne only special-cases "/" for projection naming, so a locale home gets "/zh-cn.md" - no "/" boundary, the locale matcher can't strip the prefix, and the request falls into the catch-all as a phantom slug (hard 404 on Kura's docs route; a silently WRONG flat file on apps whose catch-all renders anything - the existing fixture proved this: old code emitted a garbage de.md). Locale homes now request "//index.md" (strips to "/index.md", the home alias) and emit "/index.md", mirroring the root home. Regression assertions are red on old / green on new; suite 334/334. E2E: the trilingual build completes with zh-cn/index.md + ko/index.md in place.