File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 20
20
import os
21
21
from pathlib import Path
22
22
23
+ import yaml
23
24
24
25
DOCS_ROOT_DIR = Path (__file__ ).parent .resolve ()
25
26
26
- sys .path .insert (0 , str (DOCS_ROOT_DIR .parent / '_ext' ))
27
-
28
27
# If your extensions are in another directory, add it here. If the directory
29
28
# is relative to the documentation root, use os.path.abspath to make it
30
29
# absolute, like shown here.
71
70
'notfound.extension' ,
72
71
'sphinx_antsibull_ext' , # provides CSS for the plugin/module docs generated by antsibull
73
72
'sphinx_copybutton' ,
74
- 'ansible_redirects' ,
73
+ 'sphinx_reredirects' , # redirects pages that have been restructured or removed
75
74
]
76
75
77
76
# Later on, add 'sphinx.ext.viewcode' to the list if you want to have
379
378
autoclass_content = 'both'
380
379
381
380
# Note: Our strategy for intersphinx mappings is to have the upstream build location as the
382
- # canonical source.
381
+ # canonical source.
383
382
intersphinx_mapping = {
384
383
'python' : ('https://docs.python.org/2/' , None ),
385
384
'python3' : ('https://docs.python.org/3/' , None ),
393
392
]
394
393
linkcheck_workers = 25
395
394
# 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