mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.18k stars 501 forks source link

Links are mixed case, but files on disk are lowercase #11468

Open liudonghua123 opened 2 months ago

liudonghua123 commented 2 months ago

Summary

I tried to build the mdn contents via yarn build:prepare && yarn build, then I tried to serve the static files via npx http-server client/build/.

The url like http://localhost:8080/en-us/docs/Web/HTML/ in the html is not correct, it should be http://localhost:8080/en-us/docs/web/html/.

URL

N.A.

Reproduction steps

  1. git clone https://github.com/mdn/content.git && git clone https://github.com/mdn/yari.git
  2. cd yari
  3. yarn && yarn build:prepare && yarn build
  4. npx http-server client/build/
  5. visit http://localhost:8080/en-us/docs/Web/HTML/

Expected behavior

the link path in the generated html should the same case-sensitive as the files in the filesystem.

Actual behavior

parts of the link path becomes PascalCase.

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Windows

Screenshot

image

Anything else?

No response

Validations

LeoMcA commented 1 month ago

As a fellow case-sensitive file system user (which is obviously the correct behaviour), I feel your pain.

For now, I'd suggest you use our server which will handle the case-insensitivity for you: run that with yarn start:server.

Since the mixed case versions of links are our canonical links, I don't think the fix here should be making the links lowercase, but instead making the files on disk mixed case. This may have knock on effects to our prod deployment which we need to anticipate and potentially fix in our cloud function.

@fiji-flo perhaps a post-rari cleanup task?