docs: add rediraffe sphinx extension

This extension helps us restructure our documentation without creating
dead links. It requires us to explicitly declare what should be
redirected where though.

It seems better to have it in place ahead of time than to be something
we ask a contributor add just in time when its needed.
This commit is contained in:
Erik Sundell
2022-11-22 17:17:38 +01:00
parent d23e095106
commit bfe0186ad2
2 changed files with 15 additions and 0 deletions

View File

@@ -18,3 +18,4 @@ sphinx>=4
sphinx-copybutton
sphinx-jsonschema
sphinxext-opengraph
sphinxext-rediraffe

View File

@@ -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",
}