sinclairnick / brail

πŸ’Œ Transactional email that feels different
https://brail.dev
Apache License 2.0
258 stars 6 forks source link

Fixes 404 flashing #4

Closed manovotny closed 1 year ago

manovotny commented 1 year ago

Continuation of #3.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated
brail βœ… Ready (Inspect) Visit Preview Nov 25, 2022 at 1:21AM (UTC)
manovotny commented 1 year ago

@sinclairnick finally got some time to dig deep and got this to work! πŸ˜… πŸŽ‰

A couple of things to note.

  1. It was a new learning for me even as a longtime Vercel user and recent employee... It appears Vercel [the platform] is case sensitive. Vercel tries to look for the Introduction/intro URL, doesn't find it, triggers a 404, but the client side rendering of Docusaurus kicks in where the internal routing is case insensitive, picking up the route and rendering the page. Here’s the Docusaurus GitHub issue that was the epiphany moment for me. Which leads to...
  2. I understand why you likely chose title cased filenames for your autogenerated sidebars as Docusaurus encourages this in their documentation. But to get Docusaurus to play nicely with case sensitive URL hosts, it's better to lowercase filenames in the filesystem and links within the app. Then use use Docusaurus's category metadata to control the title casing, which is what this PR does. It's also how Vercel's official Docusaurus 2 template handles it too.

Thanks for sticking with me and allowing me contributor access to the project while we figured it out. Hopefully that all makes sense, but please ask questions if anything is unclear.

sinclairnick commented 1 year ago

@manovotny Thanks for looking into that. Frankly, I like to keep my filenames kebab-cased anyway, so happy to avoid mixed-case filenames.

Thanks for digging into this one!