fix: set trailing slash to false in docusarus config #2358
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently have 2,044 internal links that hit redirects due to a mismatch between Docusaurus (which adds trailing slashes) and Vercel (which removes them). This wastes Google's crawl budget during indexing, particularly important after our .sh to .com migration.
The fix is setting
trailingSlash: falsein Docusaurus to match Vercel's behavior. This eliminates the redirect chains that where ending in trailing slash.Related Issue or Design Document
Removed trailing slashes from static urls - #2352
Architecture Changes
Setting
trailingSlash: falsechanges how Docusaurus generates files:Before:
docs/polis/index.mdx→build/docs/polis/index.html→ URL:/docs/polis/After:
docs/polis/index.mdx→build/docs/polis.html→ URL:/docs/polisInstead of creating folders with index.html files, it creates individual HTML files. Are you aware of any potential risks?
Post-Deployment Monitoring
After going live, we need to check:
Changes in this PR
trailingSlash: falsein docusaurus.config.ts.mdxextensionChecklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Further comments