diff --git a/pyproject.toml b/pyproject.toml index 0dc7747..91fc0a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -172,3 +172,6 @@ autodoc_pydantic_model_member_order = "bysource" autodoc_pydantic_model_show_json = true autodoc_pydantic_settings_show_json = false autodoc_pydantic_model_show_field_summary = false + +# redirects +redirects = {"docs/src/testredirect"="home.html", "toplevel"="docs/src/home.html"} diff --git a/yardang/build.py b/yardang/build.py index d2b2ea8..ebc38eb 100644 --- a/yardang/build.py +++ b/yardang/build.py @@ -116,6 +116,8 @@ def generate_docs_configuration( "autodoc_pydantic_model_show_json": True, "autodoc_pydantic_settings_show_json": None, "autodoc_pydantic_model_show_field_summary": None, + # sphinx-reredirects + "redirects": {}, }.items(): configuration_args[config_option] = get_config(section=config_option, base=config_base) or default diff --git a/yardang/conf.py.j2 b/yardang/conf.py.j2 index 2747218..7bceb6e 100644 --- a/yardang/conf.py.j2 +++ b/yardang/conf.py.j2 @@ -38,6 +38,7 @@ extensions = [ "sphinx.ext.inheritance_diagram", "sphinxcontrib.mermaid", "sphinxcontrib.autodoc_pydantic", + "sphinx_reredirects", ] if use_autoapi in (True, None): # add if it is set to true or if it is set to None @@ -82,6 +83,9 @@ nb_execution_excludepatterns = {{nb_execution_excludepatterns}} #sphinxcontrib.mermaid mermaid_d3_zoom = True +# redirects +redirects = {{redirects}} + # autosummary autosummary_generate = True