Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Syllabus responds to both trailing-slash and non-trailing-slash versions of pages, but links only work on one or the other #121

Closed
illicitonion opened this issue Oct 31, 2020 · 5 comments · Fixed by #258
Labels
bug Something isn't working

Comments

@illicitonion
Copy link
Member

If you go to https://syllabus.codeyourfuture.io/git/index the links (like to the preparation page) work.

If you go to https://syllabus.codeyourfuture.io/git/index/ they don't

We should force the server to redirect one to the another, to be canonical, and make sure the links work on that version.

@illicitonion illicitonion added the bug Something isn't working label Oct 31, 2020
@ChrisOwen101
Copy link
Contributor

ChrisOwen101 commented Nov 3, 2020

@illicitonion The first one re-directs to the second one for me.

What browser are you using?

@illicitonion
Copy link
Member Author

Interesting, they do now for me, but I swear (and @ClaireBickley reported it wasn't working before... Weird.

Anywho, looks like links are always broken now, so we should fix that!

@ClaireBickley
Copy link
Contributor

Still not working for me :(

Latest Google Chrome
Version 86.0.4240.183 (Official Build) (64-bit)

Screenshot 2020-11-04 113854

@illicitonion
Copy link
Member Author

Problem diagnosis

Ok, this looks like it's a bug around links within Docusausrus pages?

If you go to https://syllabus.codeyourfuture.io/git/overview/ the link to "Week 1" is a link to https://syllabus.codeyourfuture.io/git/index

If you click it, it doesn't follow the 301 to https://syllabus.codeyourfuture.io/git/index/, it just takes you straight to https://syllabus.codeyourfuture.io/git/index. I guess it's doing a fancy pushState transition rather than a full GET?

What we should do

I think we should be writing the pages assuming the 301 is followed, so we need to change the link on index to be to ../preparation rather than preparation. This doesn't sit fantastically with me, as I view /index and /preparation as pages rather than folders, but if we have the 301 in place, it's what we should do.

But for this to work, we need to also either:

  1. Fix link in docusaurus in general so that the 301s are actually followed
  2. Change every place that we link to /git/index to instead be a link to /git/index/ - this feels error-prone, and is kind of sad.

@ChrisOwen101
Copy link
Contributor

Seems to be a known issue in Docusaurus

facebook/docusaurus#3372

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
Status: Done
3 participants