Improve support for trailing slashes
See original GitHub issue🚀 Feature
Add a preferTrailingSlashes
option (or something similar) to docusaurus.config.js
.
Have you read the Contributing Guidelines on issues?
Yes.
Motivation
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Should You Have a Trailing Slash at the End of URLs? - Ahrefs
A trailing slash is a forward slash (“/”) placed at the end of a URL such as domain.com/ or domain.com/page/. But should you...
Read more >To slash or not to slash | Google Search Central Blog
This behavior is beneficial because it reduces duplicate content. In the particular case of redirects to trailing slash URLs, our search results will...
Read more >Trailing Slash for Google AdWords - Support Center
If you're having issues with your Google Adwords and trailing slashes missing, you may need to employ a plugin to help ensure the...
Read more >Trailing Slashes in URLs – What is the Preferred Style?
The The URL of a website carries a lot of information to improve user recall and increase the websites SERP standing.
Read more >What Is a Trailing Slash in URL & How Does It Affect SEO?
It's ok to have trailing slashes after the domain name; Trailing slash matters for most URLs; Trailing slashes on hostnames don't actually ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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.