From dd8c5bfb12ce9542bc861037ec4fd70c6b042402 Mon Sep 17 00:00:00 2001 From: Jacob Hilmar Adamsen Date: Fri, 24 Oct 2025 12:40:56 +0200 Subject: [PATCH 1/4] Add Sphinx redirects --- conf.py | 11 ++++++++++- pixi.lock | 14 ++++++++++++++ pixi.toml | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 359eed82..5aab6417 100644 --- a/conf.py +++ b/conf.py @@ -63,7 +63,8 @@ def tagged_commit(): "sphinx_togglebutton", "sphinxcontrib.youtube", "sphinx_simplepdf", - "myst_nb" + "myst_nb", + "sphinx_reredirects" ] myst_enable_extensions = [ @@ -108,6 +109,14 @@ def tagged_commit(): gettext_compact = False +redirects = { + "Making_things_move/index" : "Motion_Capture_Movement/index", + "Making_things_move/lesson5" : "Motion_Capture_Movement/lesson1", + "Scaling/lesson3" : "Scaling/index", + "Scaling/lesson3_appendix" : "Scaling/index", + "Scaling/lesson4" : "Scaling/index" +} + # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path diff --git a/pixi.lock b/pixi.lock index 3e5eb6b7..f5b109d9 100644 --- a/pixi.lock +++ b/pixi.lock @@ -191,6 +191,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/sphinx-book-theme-1.1.4-pyh29332c3_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-design-0.6.1-pyhd8ed1ab_2.conda + - conda: https://prefix.dev/conda-forge/noarch/sphinx-reredirects-1.0.0-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-simplepdf-1.6.0-pyh29332c3_2.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-togglebutton-0.3.2-pyhd8ed1ab_0.tar.bz2 - conda: https://prefix.dev/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda @@ -411,6 +412,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/sphinx-book-theme-1.1.4-pyh29332c3_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-design-0.6.1-pyhd8ed1ab_2.conda + - conda: https://prefix.dev/conda-forge/noarch/sphinx-reredirects-1.0.0-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-simplepdf-1.6.0-pyh29332c3_2.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-togglebutton-0.3.2-pyhd8ed1ab_0.tar.bz2 - conda: https://prefix.dev/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda @@ -648,6 +650,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/sphinx-book-theme-1.1.4-pyh29332c3_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-design-0.6.1-pyhd8ed1ab_2.conda + - conda: https://prefix.dev/conda-forge/noarch/sphinx-reredirects-1.0.0-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-simplepdf-1.6.0-pyh29332c3_2.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-togglebutton-0.3.2-pyhd8ed1ab_0.tar.bz2 - conda: https://prefix.dev/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda @@ -870,6 +873,7 @@ environments: - conda: https://prefix.dev/conda-forge/noarch/sphinx-book-theme-1.1.4-pyh29332c3_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-copybutton-0.5.2-pyhd8ed1ab_1.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-design-0.6.1-pyhd8ed1ab_2.conda + - conda: https://prefix.dev/conda-forge/noarch/sphinx-reredirects-1.0.0-pyhd8ed1ab_0.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-simplepdf-1.6.0-pyh29332c3_2.conda - conda: https://prefix.dev/conda-forge/noarch/sphinx-togglebutton-0.3.2-pyhd8ed1ab_0.tar.bz2 - conda: https://prefix.dev/conda-forge/noarch/sphinxcontrib-applehelp-2.0.0-pyhd8ed1ab_1.conda @@ -4339,6 +4343,16 @@ packages: license_family: MIT size: 911336 timestamp: 1734614675610 +- conda: https://prefix.dev/conda-forge/noarch/sphinx-reredirects-1.0.0-pyhd8ed1ab_0.conda + sha256: 960b4459f898fb3115099b89be53dfd5903d4a7572ca0cc4dd8fafdd966b5bf9 + md5: 38f2e4c88b88a2a636fd72184a3ca8d8 + depends: + - python >=3.11 + - sphinx >=7.4 + license: MIT + license_family: MIT + size: 12679 + timestamp: 1748852791643 - conda: https://prefix.dev/conda-forge/noarch/sphinx-simplepdf-1.6.0-pyh29332c3_2.conda sha256: 07670170f40de1c9d2371fafe5b526e24fc510a4d713be5aa047d9dfc0fc5e18 md5: 05448fb057f71bb6196fe6b1be874328 diff --git a/pixi.toml b/pixi.toml index 954e6f04..e7b10e79 100644 --- a/pixi.toml +++ b/pixi.toml @@ -43,6 +43,7 @@ anypytools = ">=1.13.1,<2" scipy = ">=1.15.2,<2" ipywidgets = ">=8.1.5,<9" pydata-sphinx-theme = ">=0.15.4,<0.16" +sphinx-reredirects = ">=1.0.0,<2" [feature.test.target.win-64.dependencies] From 4c0066f9ce7883e425f703e22f7c382e14d1801f Mon Sep 17 00:00:00 2001 From: Jacob Hilmar Adamsen Date: Fri, 24 Oct 2025 13:24:01 +0200 Subject: [PATCH 2/4] Add HTML --- conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index 5aab6417..0cf1dffd 100644 --- a/conf.py +++ b/conf.py @@ -110,11 +110,11 @@ def tagged_commit(): redirects = { - "Making_things_move/index" : "Motion_Capture_Movement/index", - "Making_things_move/lesson5" : "Motion_Capture_Movement/lesson1", - "Scaling/lesson3" : "Scaling/index", - "Scaling/lesson3_appendix" : "Scaling/index", - "Scaling/lesson4" : "Scaling/index" + "Making_things_move/index" : "Motion_Capture_Movement/index.html", + "Making_things_move/lesson5" : "Motion_Capture_Movement/lesson1.html", + "Scaling/lesson3" : "Scaling/index.html", + "Scaling/lesson3_appendix" : "Scaling/index.html", + "Scaling/lesson4" : "Scaling/index.html" } # List of patterns, relative to source directory, that match files and From 76520b1cbc7159f1f8607317f94d7915f64ef036 Mon Sep 17 00:00:00 2001 From: Jacob Hilmar Adamsen Date: Fri, 24 Oct 2025 13:39:50 +0200 Subject: [PATCH 3/4] Use relative folder paths --- conf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index 0cf1dffd..90a15dca 100644 --- a/conf.py +++ b/conf.py @@ -110,11 +110,11 @@ def tagged_commit(): redirects = { - "Making_things_move/index" : "Motion_Capture_Movement/index.html", - "Making_things_move/lesson5" : "Motion_Capture_Movement/lesson1.html", - "Scaling/lesson3" : "Scaling/index.html", - "Scaling/lesson3_appendix" : "Scaling/index.html", - "Scaling/lesson4" : "Scaling/index.html" + "Making_things_move/index" : "../Motion_Capture_Movement/index.html", + "Making_things_move/lesson5" : "../Motion_Capture_Movement/lesson1.html", + "Scaling/lesson3" : "../Scaling/index.html", + "Scaling/lesson3_appendix" : "../Scaling/index.html", + "Scaling/lesson4" : "../Scaling/index.html" } # List of patterns, relative to source directory, that match files and From 053d5d232c1732b26b3dcb9fee3263ed8778b7ef Mon Sep 17 00:00:00 2001 From: Jacob Hilmar Adamsen Date: Fri, 24 Oct 2025 13:43:42 +0200 Subject: [PATCH 4/4] Only when not offline tags --- conf.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/conf.py b/conf.py index 90a15dca..f25d142b 100644 --- a/conf.py +++ b/conf.py @@ -108,14 +108,14 @@ def tagged_commit(): gettext_compact = False - -redirects = { - "Making_things_move/index" : "../Motion_Capture_Movement/index.html", - "Making_things_move/lesson5" : "../Motion_Capture_Movement/lesson1.html", - "Scaling/lesson3" : "../Scaling/index.html", - "Scaling/lesson3_appendix" : "../Scaling/index.html", - "Scaling/lesson4" : "../Scaling/index.html" -} +if not tags.has("offline"): + redirects = { + "Making_things_move/index" : "../Motion_Capture_Movement/index.html", + "Making_things_move/lesson5" : "../Motion_Capture_Movement/lesson1.html", + "Scaling/lesson3" : "../Scaling/index.html", + "Scaling/lesson3_appendix" : "../Scaling/index.html", + "Scaling/lesson4" : "../Scaling/index.html" + } # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files.