Add a flag to generate a redirect map in rustdoc #81134
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Rustdoc needs redirects in the output it produces, for example when an item is publicly re-exported. Currently redirects are implemented by generating HTML pages like this:
The problem with this approach is that the user sees the HTML page for a brief moment of time while the redirect is performed, which is not really a great UX. The HTML page also includes an inline
<script>
tag, which makes implementing content security policies harder. Still, this is the only way to implement redirects when the user visits documentation from the local filesystem or a static web server.Dynamic applications like docs.rs can provide a better UX than this though, by performing the redirects on the server side. This issue proposes a new
-Z generate-redirect-map
unstable flag, which stops generating HTML redirects and instead produces aredirect-map.json
file at the top level containing all the redirects needed by rustdoc:The text was updated successfully, but these errors were encountered: