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
Canonical links a.k.a redirection #9574
Comments
Thank you for the tips. However, I'm not sure any of these can help with the
|
@marxin, can you elaborate a bit on the use case?
For 1 I just tried to make a small prototype at https://github.com/jakobandersen/sphinx_redirect_prototype which uses
For 2, this could be an option in the intersphinx mapping. |
Sure! First, thank you very much for working on that. Our motivation are console links emitted by the GCC compiler.
Where Once we'll switch to Sphinx, I would like to emit Am I right, that now, your prototype should be working? |
Aha, very cool use case. That basically means you only need a solution to (1). I haven't looked at the prototype after #9649 got merged, but otherwise yes, aside from a bit of cleanup I think it works. |
Yes, exactly!
Please do so, having such an extension would be great! |
Can you please finish the extension once #9649 was merged? |
@tk0miya, this redirection feature could be packaged as a third-party extension, but it depends on |
@tk0miya May I please ping this? |
I'm not sure how many people will use this feature. I feel it will be used by very few people and become a secret feature. I understand it's strongly coupled with the structure of searchindex.js and searchtools.js. But, IMO, it's not enough to bundle it with sphinx-core. |
In a sense it provides "true" perma-links that will work as long as the entity is contained in the documentation somewhere, even if it gets restructured. So in the future I believe intersphinx resolution should emit these kinds of links. |
I wonder search engines can evaluate the redirects correctly. Almost of crawlers don't support JS. So it's not a good way to adopt it as a default strategy of intersphinx. |
Makes sense, thanks for working on that. |
Apparently, the 2 features are resolved, can you please push the intersphinx extension? Thanks. |
Assuming I figured out the packaging stuff correctly, it is now on PyPi: https://pypi.org/project/sphinx-redirect-by-id/.
|
Oh, great, thanks a lot! |
Let's consider an option like:
The option documentation lives somewhere here:
example.com/foo/bar/baz/a-manual-page.html#cmdoption-fmy-option
My question is if Sphinx can emit redirection for links like
example.com/redirect/cmdoption-fmy-option
?Having that, one can then rename any component in
foo/bar/baz/a-manual-page.html
and the links is gonna be stable.The text was updated successfully, but these errors were encountered: