Skip to content

Commit

Permalink
Fix redirect URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Jun 22, 2022
1 parent 6bfc42b commit 519b5db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion _ext/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ def build_redirect_pages(app, exception):
is_latest = app.config.html_context.get("is_latest")
redirects = load_redirects(app.srcdir)
for from_path, to_path in redirects.items():
assert to_path.startswith("/")
out_dir = app.outdir
if os.path.dirname(from_path) != "/":
out_dir = os.path.join(out_dir, os.path.dirname(from_path)[1:])
build_redirect_page(
os.path.join(out_dir, os.path.basename(from_path)),
"%s/en/%s/%s"
"%s/en/%s%s"
% (
app.config.html_baseurl,
("latest" if is_latest else "stable"),
Expand Down
2 changes: 1 addition & 1 deletion redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
/plus/check-tools/pvs-studio.html -> /advanced/static-code-analysis/tools/pvs-studio.html
/plus/pio-check.html -> /advanced/static-code-analysis/index.html
/plus/unit-testing.html -> /advanced/unit-testing/index.html
/projectconf.html -> projectconf/index.html
/projectconf.html -> /projectconf/index.html
/projectconf/advanced_scripting.html -> /scripting/index.html
/projectconf/dynamic_variables.html -> /projectconf/interpolation.html
/projectconf/section_env_board.html -> /projectconf/section_env_platform.html
Expand Down

0 comments on commit 519b5db

Please sign in to comment.