From a95ca255f7d886831d94dcb6f2fab7123b6ad610 Mon Sep 17 00:00:00 2001
From: Alex Clark <aclark@aclark.net>
Date: Sun, 25 Feb 2024 06:36:03 -0500
Subject: [PATCH] Add sphinx-reredirects to handle redirects

- For example, installation.html now redirects to installation/index.html
---
 docs/conf.py   | 6 ++++++
 pyproject.toml | 1 +
 2 files changed, 7 insertions(+)

diff --git a/docs/conf.py b/docs/conf.py
index 97289c91d0c..0733e2938e6 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -36,6 +36,7 @@
     "sphinx_inline_tabs",
     "sphinx_removed_in",
     "sphinxext.opengraph",
+    "sphinx_reredirects",
 ]
 
 intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
@@ -350,3 +351,8 @@
     "pillow-logo-dark-text-1280x640.png"
 )
 ogp_image_alt = "Pillow"
+
+# sphinx-reredirects
+redirects = {
+     "installation.html": "installation/index.html"
+}
diff --git a/pyproject.toml b/pyproject.toml
index 58c2464bcad..2107800d69a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -47,6 +47,7 @@ docs = [
   "sphinx-inline-tabs",
   "sphinx-removed-in",
   "sphinxext-opengraph",
+  "sphinx-reredirects",
 ]
 fpx = [
   "olefile",