comprehensive-rust
comprehensive-rust copied to clipboard
Make `/welcome.html` redirect to `/`
We currently have both
-
https://google.github.io/comprehensive-rust/
(there must be anindex.html
page here) -
https://google.github.io/comprehensive-rust/welcome.html
online. The latter is mostly seen when you navigate forward and then back to the start page.
We should only have one page and we should make https://google.github.io/comprehensive-rust/
the canonical page.
Fixing this might involve working on mdbook
to have it generate links back to the /
page instead of to /index.html
.
Make sure this works for the translations as well.
Can I work on this issue?
Can I work on this issue?
Sure, go right ahead! :smile:
Could I work on this or is already taken by someone else? 😄
Hey @lorinaX, you could discuss with @CYBWEBALI on how to solve this. I don't know what the plan is here, but I would be curious to hear :smile:
We also have another issue related to linking pages: https://github.com/google/mdbook-i18n-helpers/issues/35. That would also require changing mdbook
or (probably easier) write a tool which can add the necessary HTML after the book has been rendered.
Hi @CYBWEBALI and @lorinaX, please let me know if you have an idea for how to solve this :smile: It would be good to discuss it before either of you invest a lot of time into it.
well since the other guy didn't grab this issue, I'll go ahead and work on it right now I have a few ideas on how I can do this, I will make sure to update you after I have finished a few ideas, shouldn't take me too long!
Okay I'll be waiting to be updated
Sent from Yahoo Mail on Android
On Sun, Jun 25, 2023 at 8:39 AM, Lorina @.***> wrote:
well since the other guy didn't grab this issue, I'll go ahead and work on it right now I have a few ideas on how I can do this, I will make sure to update you after I have finished a few ideas, shouldn't take me too long!
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Can you give me some exact steps for me to replicate this, I did some changes and I think it should be fine now.
What do you think was the issue and what steps did you take for you to make the changes?
Sent from Yahoo Mail on Android
On Sun, Jun 25, 2023 at 9:51 AM, Lorina @.***> wrote:
Can you give me some exact steps for me to replicate this, I did some changes and I think it should be fine now.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
When we go to (comprehensive-rust/index.html). This should correspond to the canonical URL https://google.github.io/comprehensive-rust/ and when we navigate through the book and we navigate back to the start page the url should be https://google.github.io/comprehensive-rust/ and not https://google.github.io/comprehensive-rust/welcome.html.
This is to my understanding and I want to make sure I don't miss any edge case or have misunderstood the problem in any way before making a PR that is why I asked for the exact steps to replicate the problem, to fix this issue was pretty simple you just need to add the following to book.toml: [output.html.redirects] "/index.html" = "/"
and to make sure we have a conical-url in the [output.excerciser] canonical-url = "http://localhost:8000" (example of my cononical-url)
(Update) unless you can run a small server I don't think there would be way to redirect this since you are hosting on github pages, my local version works with tokio and warp.
So I'm in the book already idk shit what's the name of the book I'm go get me one
Sent from Yahoo Mail on Android
On Sun, Jun 25, 2023 at 10:11 AM, Lorina @.***> wrote:
When we go to (comprehensive-rust/index.html). This should correspond to the canonical URL https://google.github.io/comprehensive-rust/ and when we navigate through the book and we navigate back to the start page the url should be https://google.github.io/comprehensive-rust/ and not https://google.github.io/comprehensive-rust/welcome.html.
This is to my understanding and I want to make sure I don't miss any edge case or have misunderstood the problem in any way before making a PR that is why I asked for the exact steps to replicate the problem, to fix this issue was pretty simple you just need to add the following to book.toml: [output.html.redirects] "/index.html" = "/"
and to make sure we have a conical-url in the [output.excerciser] canonical-url = "http://localhost:8000"
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
lorinaX
I think when you set
[output.html.redirects] "/index.html" = "/"
After putting this in book.toml
file
As per docs of mdbook there is no such options, canonical-url = "http://localhost:8000"
So I'm in the book already idk shit what's the name of the book I'm go get me one
Hi @Tnation888, it's great if you want to help out, but I don't understand your comment here?
I think when you set
"/index.html" = "/"
It continuously re-renders the page.
Yeah, good point! Right now there are 3 valid URLs for the same page:
- https://google.github.io/comprehensive-rust/ (preferred, works because of
index.html
and a GitHub default) - https://google.github.io/comprehensive-rust/welcome.html (named after the Markdown file)
- https://google.github.io/comprehensive-rust/index.html (generated by
mdbook
, I haven't looked up how)
Perhaps we could start by renaming welcome.md
to index.md
? That would reduce the number of URLs by one.
I think when you set
"/index.html" = "/"
It continuously re-renders the page.
Yeah, good point! Right now there are 3 valid URLs for the same page:
- https://google.github.io/comprehensive-rust/ (preferred, works because of
index.html
and a GitHub default)- https://google.github.io/comprehensive-rust/welcome.html (named after the Markdown file)
- https://google.github.io/comprehensive-rust/index.html (generated by
mdbook
, I haven't looked up how)Perhaps we could start by renaming
welcome.md
toindex.md
? That would reduce the number of URLs by one.
I can try this.
I renamed welcome.md
to index.md
in #1039. It would still be nice if /index.html
URLs would instead become /
(for all languages), but that's probably something we need to fix in upstream mdbook.
This upstream issue would take care of removing the index.html
parts from our URLs: https://github.com/rust-lang/mdBook/issues/1251.