Skip to content

fix: lowercase jurisdiction slugs so mixed-case filenames stop 404ing - #43

Closed
mzf11125 wants to merge 3 commits into
ethsystems:mainfrom
mzf11125:fix/jurisdiction-mixed-case-slugs
Closed

fix: lowercase jurisdiction slugs so mixed-case filenames stop 404ing#43
mzf11125 wants to merge 3 commits into
ethsystems:mainfrom
mzf11125:fix/jurisdiction-mixed-case-slugs

Conversation

@mzf11125

@mzf11125 mzf11125 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Astro glob ids lowercase map filenames (id-OJK.md is served at /jurisdictions/id-ojk/), but markdown rewrite, related links, FAQ, and the graph panel kept the original case, so those hops 404ed.
  • Generated routes now use 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
  • See also on OJK and MAS lands on a live page
  • FAQ MiCA link lands on /jurisdictions/eu-mica/

Made with Cursor

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>
mzf11125 and others added 2 commits September 4, 2026 22:13
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>
@mzf11125

mzf11125 commented Sep 4, 2026

Copy link
Copy Markdown
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:
https://github.com/mzf11125/web/actions/runs/33882560402

That job ran npm test, content refs, and npm run build.

The upstream Deploy site run is still waiting on maintainer approval:
https://github.com/ethsystems/web/actions/runs/33881131168

@oskarth
oskarth requested a review from rymnc September 8, 2026 06:58
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>
@rymnc

rymnc commented Sep 8, 2026

Copy link
Copy Markdown
Member

hi @mzf11125 thank you for your PR! we've cherry-picked your changes and removed the ci.yml file you added. e2360ed

attribution is preserved :) so it still counts as a contribution!

@rymnc rymnc closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants