freeCodeCamp / contribute

> docs site for all things contributions. begin your contribution journey here.
https://contribute.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
39 stars 54 forks source link

URL trailing slashes dev vs production #332

Closed gikf closed 2 weeks ago

gikf commented 3 weeks ago

Describe the bug

There's difference how develop and production handles trailing slashes, or lack of in the internal links. In production trailing slashes are added to url when page is opened. That's not a case in dev.

To Reproduce

  1. pnpm run develop
  2. Trailing slashes are not added when opening page, ie. https://contribute.freecodecamp.org/how-to-translate-files stays like that.
  3. Sidebar highlight and Next/Prev links are working correctly. vs
  4. pnpm run build && pnpm start or use production.
  5. Trailing slashes are added, ie. https://contribute.freecodecamp.org/how-to-translate-files -> https://contribute.freecodecamp.org/how-to-translate-files/
  6. Sidebar highlight is not working because sidebar links don't use trailing slashes.
  7. Similarly Next/Prev links are messed up with actual url containing trailing slashes.

Expected behavior

Limit the discrepancy between develop and production, to not make it appear working (in dev), when it's actually not working (in production).

Additional context