From 519b5db43440c219e6388e6d64f53850bc6882ca Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 22 Jun 2022 13:14:36 +0300 Subject: [PATCH] Fix redirect URL --- _ext/redirects.py | 3 ++- redirects.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/_ext/redirects.py b/_ext/redirects.py index 79cebba221..49ec13d82f 100644 --- a/_ext/redirects.py +++ b/_ext/redirects.py @@ -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"), diff --git a/redirects.txt b/redirects.txt index 9726827f96..c72d6cffd2 100644 --- a/redirects.txt +++ b/redirects.txt @@ -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