fix: lowercase jurisdiction slugs so mixed-case filenames stop 404ing - #43
Closed
mzf11125 wants to merge 3 commits into
Closed
fix: lowercase jurisdiction slugs so mixed-case filenames stop 404ing#43mzf11125 wants to merge 3 commits into
mzf11125 wants to merge 3 commits into
Conversation
Astro glob ids are lowercase while map filenames keep original case, so See also links to id-OJK and eu-MiCA missed the live pages. Co-authored-by: Cursor <cursoragent@cursor.com>
Deploy site on ethsystems/web waits for maintainer approval of fork PRs. This job runs test, content refs, and production build on any push so the fork can produce a check. Co-authored-by: Cursor <cursoragent@cursor.com>
Vitest imports render.ts which needs the generated graph file. Local builds already had it. The runner does not. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
Fork Actions is now running. GitHub had not indexed workflows on mzf11125/web until a workflow file landed on this branch. Green CI run on the fork: That job ran npm test, content refs, and npm run build. The upstream Deploy site run is still waiting on maintainer approval: |
rymnc
pushed a commit
that referenced
this pull request
Sep 8, 2026
…#19) Mirrors [#43](#43) by @mzf11125, minus the `.github/workflows/ci.yml` addition. ## Summary - Astro's glob loader lowercases collection ids, so `content/jurisdictions/id-OJK.md` is served at `/jurisdictions/id-ojk/`. The markdown rewrite, related links, FAQ, and graph panel all kept the original filename case, so those hops 404ed. - Generated routes now go through a shared `toContentSlug()`, and filename-cased inbound URLs redirect to the lowercase pages. ## What changed relative to web#43 The upstream PR hand-listed six jurisdiction redirects in `astro.config.mjs`. That closes today's 404s but drifts the moment `ethsystems/map` adds another mixed-case file. Two follow-up changes in the second commit: - `src/lib/content-redirects.ts` derives the redirect map from the routed content directories using the same `toContentSlug()` rule the route builders use, so the two cannot diverge. `README.md`/`_template.md` are skipped to match the collection globs, and a missing `content/` submodule degrades to an empty map rather than failing config load. - `remark-approach-variants.ts` was the one remaining place building an href from a raw frontmatter slug (`example_vendors` → `/vendors/<slug>/`). No vendor file is mixed-case today, so this is not a live 404 — it is the same bug class the PR set out to close. - `tests/content-redirects.test.ts` covers the six known jurisdictions, the no-op and README exclusions, and the missing-submodule path. The CI workflow from web#43 was intentionally dropped — it existed to give a fork PR a runnable check on the public repo. ## Verification - `npm test` — 55 passed (4 files) - `npm run build` — 205 pages, same count as `main` - Built output confirms `/jurisdictions/{id-OJK,sg-MAS,eu-EUDR,eu-MiCA,us-SEC,de-eWpG}/` emit redirect stubs to their lowercase targets, and the lowercase pages render - No residual mixed-case collection hrefs remain in `dist/` - `npm run check` reports 63 errors on this branch and the same pre-existing errors on `main`; none reference the changed files Prompted by: ac --------- Co-authored-by: M Zidan Fatonie <mzidanfatonie@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: ethsystems-bot <321619048+ethsystems-bot@users.noreply.github.com>
Member
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
id-OJK.mdis served at/jurisdictions/id-ojk/), but markdown rewrite, related links, FAQ, and the graph panel kept the original case, so those hops 404ed.toContentSlug(), and mixed-case inbound URLs redirect to the lowercase pages.Test plan
/jurisdictions/id-ojk/,/jurisdictions/sg-mas/,/jurisdictions/eu-eudr/still load/jurisdictions/id-OJK/,/jurisdictions/sg-MAS/,/jurisdictions/eu-EUDR/,/jurisdictions/eu-MiCA/,/jurisdictions/us-SEC/,/jurisdictions/de-eWpG/redirect to the lowercase pages/jurisdictions/eu-mica/Made with Cursor