File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 2020import os
2121from pathlib import Path
2222
23+ import yaml
2324
2425DOCS_ROOT_DIR = Path (__file__ ).parent .resolve ()
2526
26- sys .path .insert (0 , str (DOCS_ROOT_DIR .parent / '_ext' ))
27-
2827# If your extensions are in another directory, add it here. If the directory
2928# is relative to the documentation root, use os.path.abspath to make it
3029# absolute, like shown here.
7170 'notfound.extension' ,
7271 'sphinx_antsibull_ext' , # provides CSS for the plugin/module docs generated by antsibull
7372 'sphinx_copybutton' ,
74- 'ansible_redirects' ,
73+ 'sphinx_reredirects' , # redirects pages that have been restructured or removed
7574]
7675
7776# Later on, add 'sphinx.ext.viewcode' to the list if you want to have
379378autoclass_content = 'both'
380379
381380# Note: Our strategy for intersphinx mappings is to have the upstream build location as the
382- # canonical source.
381+ # canonical source.
383382intersphinx_mapping = {
384383 'python' : ('https://docs.python.org/2/' , None ),
385384 'python3' : ('https://docs.python.org/3/' , None ),
393392]
394393linkcheck_workers = 25
395394# linkcheck_anchors = False
395+
396+ # Generate redirects for pages that have been restructured or moved
397+ # if EXTRA_TAGS="-t redirects" is passed with the make invocation
398+ redirects = {}
399+ if tags .has ('redirects' ):
400+ redirects_config_path = DOCS_ROOT_DIR .parent / "ansible_redirects.yaml"
401+ redirect_keys = yaml .safe_load (
402+ redirects_config_path .read_text (encoding = "utf-8" )
403+ )
404+ redirects = redirect_keys
You can’t perform that action at this time.
0 commit comments