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
pnpm run develop
Trailing slashes are not added when opening page, ie. https://contribute.freecodecamp.org/how-to-translate-files stays like that.
Sidebar highlight and Next/Prev links are working correctly.
vs
pnpm run build && pnpm start or use production.
Trailing slashes are added, ie. https://contribute.freecodecamp.org/how-to-translate-files -> https://contribute.freecodecamp.org/how-to-translate-files/
Sidebar highlight is not working because sidebar links don't use trailing slashes.
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
Astro has trailingSlash configuration option, which can be used to always use trailing slashes https://docs.astro.build/en/reference/configuration-reference/#trailingslash. This will however result in develop in 404 error for any link without the trailing slash, so every internal link in sidebar or header would need to have trailing slash added. I had also some troubles with /FAQ/ it was always redirected to /faq.
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
pnpm run develop
https://contribute.freecodecamp.org/how-to-translate-files
stays like that.pnpm run build && pnpm start
or use production.https://contribute.freecodecamp.org/how-to-translate-files
->https://contribute.freecodecamp.org/how-to-translate-files/
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
trailingSlash
configuration option, which can be used to always use trailing slashes https://docs.astro.build/en/reference/configuration-reference/#trailingslash. This will however result in develop in404
error for any link without the trailing slash, so every internal link in sidebar or header would need to have trailing slash added. I had also some troubles with/FAQ/
it was always redirected to/faq
.