diff --git a/docs/requirements.txt b/docs/requirements.txt index bd71f28e..6748578b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -18,3 +18,4 @@ sphinx>=4 sphinx-copybutton sphinx-jsonschema sphinxext-opengraph +sphinxext-rediraffe diff --git a/docs/source/conf.py b/docs/source/conf.py index f36304e6..736a0acb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -35,6 +35,7 @@ extensions = [ "sphinx_copybutton", "sphinx-jsonschema", "sphinxext.opengraph", + "sphinxext.rediraffe", "myst_parser", ] root_doc = "index" @@ -199,3 +200,16 @@ intersphinx_mapping = { # ogp_site_url is set automatically by RTD ogp_image = "_static/logo.png" ogp_use_first_image = True + + +# -- Options for the rediraffe extension ------------------------------------- +# ref: https://github.com/wpilibsuite/sphinxext-rediraffe#readme +# +# This extensions help us relocated content without breaking links. If a +# document is moved internally, a redirect like should be configured below to +# help us not break links. +# +rediraffe_branch = "main" +rediraffe_redirects = { + # "old-file": "new-folder/new-file-name", +}