diff --git a/.ci/docker/requirements.txt b/.ci/docker/requirements.txt index bd3711bfb0e..2384fb1b00e 100644 --- a/.ci/docker/requirements.txt +++ b/.ci/docker/requirements.txt @@ -6,6 +6,7 @@ sphinx-gallery==0.11.1 sphinx_design docutils==0.16 sphinx-copybutton +sphinx_sitemap==2.6.0 pypandoc==1.12 pandocfilters markdown diff --git a/.gitmodules b/.gitmodules index 8b137891791..e69de29bb2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1 +0,0 @@ - diff --git a/conf.py b/conf.py index e4bca1ac7fa..4ab380a7b3d 100644 --- a/conf.py +++ b/conf.py @@ -82,6 +82,7 @@ 'sphinx_copybutton', 'sphinx_gallery.gen_gallery', 'sphinx_design', + 'sphinx_sitemap' ] intersphinx_mapping = { @@ -120,6 +121,14 @@ def reset_seeds(gallery_conf, fname): }, } +html_baseurl = 'https://pytorch.org/tutorials/' # needed for sphinx-sitemap +sitemap_locales = [None] +sitemap_excludes = [ + "search.html", + "genindex.html", +] +sitemap_url_scheme = "{link}" + if os.getenv('GALLERY_PATTERN'): # GALLERY_PATTERN is to be used when you want to work on a single # tutorial. Previously this was fed into filename_pattern, but @@ -182,7 +191,7 @@ def reset_seeds(gallery_conf, fname): # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'src/pytorch-sphinx-theme/docs*'] exclude_patterns += sphinx_gallery_conf['examples_dirs'] exclude_patterns += ['*/index.rst']