-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback on trailingSlash option + GH Pages #2
Comments
Hi! This project is not directly related to Docusaurus so can you re-open this issue on Docusaurus instead? I'll look at this on Monday anyway
I don't understand, Docusaurus does not create an Can you deploy your site with the bug somewhere (a fork?), so that I can see the live site + have the ability to inspect the gh-branch?
I don't think, we don't want to hardcode special cases per host. GH pages should be able to serve files without needing/redirecting a trailing slash, cf https://slorber.github.io/trailing-slash-guide/file |
@slorber All right, I'll try to make a reproduction and file a report. I didn't report on Docusaurus because I wasn't sure it's really a bug...
Sure hardcoding is bad, however there could be an actionable solution for all those who're using GH pages and don't want to suffer from degraded SEO. Perhaps |
Yes we should provide options so that it works fine with GH pages, it was
the purpose of trailingSlash: false
If it doesn't work we should just fix it. I surprised because someone has
confirmed trailingSlash: false was working fine on his GH pages site, so
I'll have to investigate this
Le sam. 26 juin 2021 à 21:23, Jules Sam. Randolph ***@***.***>
a écrit :
… @slorber <https://github.com/slorber> All right, I'll try to make a
reproduction and file a report. I didn't report on Docusaurus because I
wasn't sure it's really a bug...
I don't think, we don't want to hardcode special cases per host.
Sure hardcoding is bad, however there could be an actionable solution for
all those who're using GH pages and don't want to suffer from degraded SEO.
Perhaps trailingSlash: 'root' meaning, one trailing slash is expected for
the top level route, no trailing slash for other routes. That would match
per-repository GH Pages deployments.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW6PUBCDWTB4N3ATAYP43TUYSLDANCNFSM47LLLUFA>
.
|
Closing in favor of facebook/docusaurus#5077 |
@slorber
Issue / Bug?
I've set
"trailingSlash": false
on my project following suggestions by the CLI. I have a non-empty base-url, and here is what happens when fetching https://meliorence.github.io/react-native-render-html:> http -h https://meliorence.github.io/react-native-render-html HTTP/1.1 301 Moved Permanently Location: https://meliorence.github.io/react-native-render-html/ ...
OK, so GH pages redirects the root (a file named react-native-render-html.html in the gh-pages branch) to the slash-forwards path. That's not great for SEO (unless the sitemap reflects that), but at least if it works... Let's fetch the redirected-url:
> http -h https://meliorence.github.io/react-native-render-html/ HTTP/1.1 200 OK
Good.... However, if you try that out in a browser, you'll see a "Not Found" flash. My understanding of what's happening:
404.mp4
Workaround
After a docusaurus build, the gh-pages branch folder structure looks like this:
By copying
react-native-render-html.html
intoindex.html
and pushing, the "Not Found" flash bug disappears.Additional information
@docusaurus/*@2.0.0-beta.4d93c894f
Remarks
Ideally, the sitemap generated for gh-pages would add a trailing slash to the root URL to avoid redirects, or there could be an option to deal with the root.
The text was updated successfully, but these errors were encountered: