Open swheaton opened 3 years ago
Bump
Bump2. Anyone checking this repo?
Hello, this addition is rather useful. Can we get someone to merge it in?
maybe @ashmaroli , @DirtyF , @parkr ?
Can we bump this? @DirtyF I'll just tag you since it seems you've contributed recently.
Hello everyone, I've taken a look at this. The patch introduces a significant amount of JS code without test coverage. That is not acceptable. Why not handle the computation in Ruby itself instead of JS?
Thank you for taking a look @ashmaroli.
This was months ago but if I remember right, it's because you want to be able to redirect to specific anchors on the permanent page, which happens dynamically. I don't think you can do it in Ruby (which runs at site build time) unless along with registering the redirect you somehow also registered all anchor and parameter possibilities.
At least, I cannot think of a way. But I am no Ruby expert by far. If you have an idea, please let me know and I will be happy to try my hand at an alternative solution.
If not, how do you propose increasing test coverage? The current test framework can only test Ruby code if I'm not mistaken.
to be able to redirect to specific anchors on the permanent page, which happens dynamically..
Oh right. There's no easy way to this before hand. We sure are in a sticky situation here..
Summary
This change allows anchors (#heading) and parameters (?q=a) in a URL to be passed along to the redirected page. The use case for this would be when linking readers to a specific section of a page, and wanting the link to work for either the permalink page or the redirected page. I don't have a use case for query parameters, but it's the same idea so I don't see why not.
Current
If
oldPath/index.html
redirects tohttp://jekyllrb.com/2014/01/03/redirect-me-plz.html
Then any link containing anchors or parameters is broken, such as the following:
http://jekyllrb.com/oldPath#important-subsection?question=answer
Will redirect to the base page, stripping off the extras:http://jekyllrb.com/2014/01/03/redirect-me-plz.html
Proposed
I propose that the link:
http://jekyllrb.com/oldPath#important-subsection
Should redirect tohttp://jekyllrb.com/2014/01/03/redirect-me-plz.html#important-subsection?question=answer
Technical Details
location.hash
andlocation.search
to the jump location.location.hash
andlocation.search
.