-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Docs: Redirects for subpages implemented #10948
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
Conversation
docs/page.js
Outdated
|
||
if ( page[ 1 ] === section + '/' + path ) { | ||
|
||
redirectUrl = 'index.html#' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirectUrl = 'index.html#'
To be consistent with links from the sidebar this should just be
redirectUrl = '#'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course index.html
is redundant. Seems that I didn’t see the forest for the trees ;-)
Thanks!
Rather than redirecting... How about changing the links so when you click them you end up in the docs? |
I am not sure whether I understand you correctly(?) Putting myself in the situation of a programmer searching for “three.js SkinnedMesh” on google I would expect, that a link which leads to a subpage of threejs.org (in this case https://threejs.org/docs/api/objects/SkinnedMesh.html) would work correctly (which is currently not the case). But I would not have the expectation that a link from forked repositories would automagically work in the same way. So this was not the use case I had in mind. |
No no... Say that the user ends up in https://threejs.org/docs/api/objects/SkinnedMesh.html. What I'm saying is to change the code so when the user clicks on 'Object3D` on the top-left, the link goes to https://threejs.org/docs/#Reference/Core/Object3D. |
Thanks for your clarification. I hope that I now understand the direction in which you wanted to point me (but I am not yet sure). Your suggestion is to make no redirection at all, but to change the links on the subpages level only? 1. Version with redirection
With my implementation the user should never “end up” in https://threejs.org/docs/api/objects/SkinnedMesh.html, since he is immediately directed to https://threejs.org/docs/#Reference/Objects/SkinnedMesh. In this way all links (and the “Edit”-button) should work correctly, and the additional advantage would be that coming from google&Co. the navigation panel is always immediately available (collapsed to a hamburger button on small devices) – I guess this is the “normal” behavior a user (who doesn’t need to know about the internal iframes structure) would expect from a modern website. Since the forwarding to the higher level is done with
2. Version without redirection If we would go without this redirection and “only” fix the links (wouldn’t that be more complicated anyway?), the user would miss the full possibilities of the navigation panel, until he has the idea to click on a link that takes him away from this particular subpage (iframe). This would remind me in an unpleasant way of old fashion HTML frame architectures.
|
I think my worry is that we're dragging a design mistake... Currently we have:
I think this should just be:
This way the redirection code will be much simpler. |
I absolutely agree. As far as I can see there are (at least) two problems with the docs which are existing separately (but the final solution of No.1 depends on whether and how No.2 is solved):
Being new to three.js, I thought that there must be some kind of mystic reason for No.2 which my mind couldn’t grasp 😉 ; therefore I didn’t want to change this all at once and focused on an isolated solution for No.1 instead. @mrdoob If you want, I would close this issue and work on a solution for No.2 first (synchronizing the two structures and cleaning up the existing code in index.html). After this the solution for No.1 would be indeed much simpler. @looeee Of course I am also very interested in your opinion and advice, since you have broad experience with the docs. |
Yep yep! I appreciate that.
Yes! That would be great! 👍 |
It seems to be much easier than I thought (no synchronizing of the two present structures needed): If we simply use in index.html the original urls of the iframe-pages and completely forget the conversion into the second url format, all seems to work perfectly, in and from all directions - without any other changes (besides a very simple redirection from the subpages). There must have been a reason why this second url track with the complex conversion was invented some centuries ago, but it seems that this reason is no longer existent ;) But now I would like to take the time to make a thorough refactoring (and simplification) of this index.html first before making a new PR. |
Related to #10937
Pages reached from outside (for instance via google) are now correctly displayed (with navigation panel and working links),
by redirecting pages with URLs such as the following ones …
… to their corresponding iframe-URLs (using docs/list.js for mapping):