Skip to content

Backport PR #19793 on branch v3.4.x (Fix non existent URI s) #19815

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions doc/sphinxext/redirect_from.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def run(self):
raise ValueError(
f"{redirected_reldoc} is already noted as redirecting to "
f"{self.redirects[redirected_reldoc]}")
self.redirects[redirected_reldoc] = builder.get_relative_uri(
redirected_reldoc, current_doc)
self.redirects[redirected_reldoc] = current_doc
return []


Expand All @@ -76,7 +75,7 @@ def _generate_redirects(app, exception):
return
for k, v in RedirectFrom.redirects.items():
p = Path(app.outdir, k + builder.out_suffix)
html = HTML_TEMPLATE.format(v=v)
html = HTML_TEMPLATE.format(v=builder.get_relative_uri(k, v))
if p.is_file():
if p.read_text() != html:
logger.warning(f'A redirect-from directive is trying to '
Expand Down