Add a preferTrailingSlashes option (or something similar) to docusaurus.config.js.
Yes.
If hosting documentation on GitHub Pages, a trailing slash appears in the URL when navigating to a specific Docusaurus page from outside the docs.
For instance, https://glaze.js.org/docs/introduction sends the visitor to https://glaze.js.org/docs/introduction/.
In order to keep consistency, there should be an option for sidebar links to have a trailing comma by default, without resorting to a longer sidebar item format.
I've noticed that the trailing slash potentially destroys internal links as well since the relative root is different. Don't know if this is a separate bug or a side effect.
@davidhagg Same here. I'm deploying to GH Pages (v2, latest alpha). It seems like it adds / always to all pages, so relative links are broken :(
This also breaks Azure Front Door routes. I migrated a Docusaurus + GitHub Pages site to Azure Web Apps behind an Azure Front Door and all site pages without a trailing / redirect by Front Door presumably correctly, but the Docusaurus compiled application routes to a / and when it does this is referrer is the backend server name not the custom domain name with the URL and trailing / appended.
It appears, also there may be something deployed in the root that does dynamic routing, otherwise, I'd expect Docusaurus compiler to simply create all URL paths with / or without.
I like this feature request and hope it addresses my issue as well.
I think we should take a stance here and add trailing / to all Docusaurus-generated URLs. This will bridge the differences during development and deployed. cc @lex111 @slorber
Closing in favor of https://github.com/facebook/docusaurus/issues/3372
Most helpful comment
I think we should take a stance here and add trailing / to all Docusaurus-generated URLs. This will bridge the differences during development and deployed. cc @lex111 @slorber