From 281b160a28ea5b71479e15d245e99412dfeb4f6c Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Wed, 4 Sep 2024 12:59:26 -0700 Subject: [PATCH 1/9] 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 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/conf.py b/conf.py index f0f4905844c..5d84d277501 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 From 5007dd69c0d592b605cd3ef83e70878de296dfef Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Wed, 4 Sep 2024 15:12:13 -0700 Subject: [PATCH 2/9] Update --- conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.py b/conf.py index 5d84d277501..5bde4c33d22 100644 --- a/conf.py +++ b/conf.py @@ -121,6 +121,7 @@ def reset_seeds(gallery_conf, fname): "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 From d1143048299e43b5f0068feb217eb45eabb3f2f9 Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Wed, 4 Sep 2024 16:28:18 -0700 Subject: [PATCH 3/9] Update --- conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conf.py b/conf.py index 5bde4c33d22..31978f50f5f 100644 --- a/conf.py +++ b/conf.py @@ -120,6 +120,7 @@ def reset_seeds(gallery_conf, fname): sitemap_excludes = [ "search.html", "genindex.html", + "src/*" ] sitemap_url_scheme = "{link}" From 620c97fc10be742f65ce218bf92764e33b68a538 Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Thu, 5 Sep 2024 10:58:40 -0700 Subject: [PATCH 4/9] Update --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 31978f50f5f..ccca12e73d9 100644 --- a/conf.py +++ b/conf.py @@ -120,7 +120,7 @@ def reset_seeds(gallery_conf, fname): sitemap_excludes = [ "search.html", "genindex.html", - "src/*" + "src/**", ] sitemap_url_scheme = "{link}" From 13a573185707d3e35fa1dd974093731d63209ec3 Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Thu, 5 Sep 2024 12:30:14 -0700 Subject: [PATCH 5/9] Update --- conf.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/conf.py b/conf.py index ccca12e73d9..bf30bbcd4bf 100644 --- a/conf.py +++ b/conf.py @@ -120,7 +120,15 @@ def reset_seeds(gallery_conf, fname): sitemap_excludes = [ "search.html", "genindex.html", - "src/**", + "src/pytorch-sphinx-theme/docs/changelog.html", + "src/pytorch-sphinx-theme/docs/configuring.html", + "src/pytorch-sphinx-theme/docs/demo/api.html", + "src/pytorch-sphinx-theme/docs/demo/demo.html", + "src/pytorch-sphinx-theme/docs/demo/lists_tables.html", + "src/pytorch-sphinx-theme/docs/demo/long.html", + "src/pytorch-sphinx-theme/docs/demo/structure.html", + "src/pytorch-sphinx-theme/docs/index.html", + "src/pytorch-sphinx-theme/docs/installing.html" ] sitemap_url_scheme = "{link}" From 8298da25782e3b591dd82478dd7d4dbfcb0109b0 Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Thu, 5 Sep 2024 15:18:09 -0700 Subject: [PATCH 6/9] Remove PyTorch sphinx theme as submodule --- .gitmodules | 3 --- conf.py | 9 --------- 2 files changed, 12 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3a3c564c8fa..e69de29bb2d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "src/pytorch-sphinx-theme"] - path = src/pytorch-sphinx-theme - url = https://github.com/pytorch/pytorch_sphinx_theme diff --git a/conf.py b/conf.py index bf30bbcd4bf..5bde4c33d22 100644 --- a/conf.py +++ b/conf.py @@ -120,15 +120,6 @@ def reset_seeds(gallery_conf, fname): sitemap_excludes = [ "search.html", "genindex.html", - "src/pytorch-sphinx-theme/docs/changelog.html", - "src/pytorch-sphinx-theme/docs/configuring.html", - "src/pytorch-sphinx-theme/docs/demo/api.html", - "src/pytorch-sphinx-theme/docs/demo/demo.html", - "src/pytorch-sphinx-theme/docs/demo/lists_tables.html", - "src/pytorch-sphinx-theme/docs/demo/long.html", - "src/pytorch-sphinx-theme/docs/demo/structure.html", - "src/pytorch-sphinx-theme/docs/index.html", - "src/pytorch-sphinx-theme/docs/installing.html" ] sitemap_url_scheme = "{link}" From fc74ed6693fc34184b70d9206fdc5a2f092ab56c Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Fri, 6 Sep 2024 14:56:38 -0700 Subject: [PATCH 7/9] Exclude src/pytorch_sphinx_theme/docs from the build --- conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 97b228e4363..28ab526528e 100644 --- a/conf.py +++ b/conf.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- +# -* coding: utf-8 -*- # # PyTorch Tutorials documentation build configuration file, created by # sphinx-quickstart on Wed Mar 8 22:38:10 2017. @@ -191,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'] From fdeae45066ee8dd10ec4d7507d905e2c0858393b Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Fri, 6 Sep 2024 15:51:31 -0700 Subject: [PATCH 8/9] Update conf.py --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 28ab526528e..0257ec73c29 100644 --- a/conf.py +++ b/conf.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# -* coding: utf-8 -*- +# -*- coding: utf-8 -*- # # PyTorch Tutorials documentation build configuration file, created by # sphinx-quickstart on Wed Mar 8 22:38:10 2017. From 2977890f01b8a38d4f41ecd0d5e00309872b1b5c Mon Sep 17 00:00:00 2001 From: Svetlana Karslioglu Date: Mon, 9 Sep 2024 12:53:28 -0700 Subject: [PATCH 9/9] Update --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 0257ec73c29..4ab380a7b3d 100644 --- a/conf.py +++ b/conf.py @@ -191,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', 'src/pytorch_sphinx_theme/docs'] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'src/pytorch-sphinx-theme/docs*'] exclude_patterns += sphinx_gallery_conf['examples_dirs'] exclude_patterns += ['*/index.rst']