Skip to content

Commit a30e74f

Browse files
authored
Merge pull request #67 from python-project-templates/tkp/red
Add sphinx-reredirect support, fixes #63
2 parents 4b5eeb3 + fb3c055 commit a30e74f

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,6 @@ autodoc_pydantic_model_member_order = "bysource"
172172
autodoc_pydantic_model_show_json = true
173173
autodoc_pydantic_settings_show_json = false
174174
autodoc_pydantic_model_show_field_summary = false
175+
176+
# redirects
177+
redirects = {"docs/src/testredirect"="home.html", "toplevel"="docs/src/home.html"}

yardang/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ def generate_docs_configuration(
116116
"autodoc_pydantic_model_show_json": True,
117117
"autodoc_pydantic_settings_show_json": None,
118118
"autodoc_pydantic_model_show_field_summary": None,
119+
# sphinx-reredirects
120+
"redirects": {},
119121
}.items():
120122
configuration_args[config_option] = get_config(section=config_option, base=config_base) or default
121123

yardang/conf.py.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ extensions = [
3838
"sphinx.ext.inheritance_diagram",
3939
"sphinxcontrib.mermaid",
4040
"sphinxcontrib.autodoc_pydantic",
41+
"sphinx_reredirects",
4142
]
4243
if use_autoapi in (True, None):
4344
# add if it is set to true or if it is set to None
@@ -82,6 +83,9 @@ nb_execution_excludepatterns = {{nb_execution_excludepatterns}}
8283
#sphinxcontrib.mermaid
8384
mermaid_d3_zoom = True
8485

86+
# redirects
87+
redirects = {{redirects}}
88+
8589
# autosummary
8690
autosummary_generate = True
8791

0 commit comments

Comments
 (0)