From 281b160a28ea5b71479e15d245e99412dfeb4f6c Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Wed, 4 Sep 2024 12:59:26 -0700 Subject: [PATCH] Add sitemap --- .ci/docker/requirements.txt | 1 + conf.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.ci/docker/requirements.txt b/.ci/docker/requirements.txt index bd3711bfb0..2384fb1b00 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/conf.py b/conf.py index f0f4905844..5d84d27750 100644 --- a/conf.py +++ b/conf.py @@ -76,6 +76,7 @@ 'sphinx_copybutton', 'sphinx_gallery.gen_gallery', 'sphinx_design', + 'sphinx_sitemap' ] intersphinx_mapping = { @@ -114,6 +115,13 @@ 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", +] + 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