Skip to content

Commit

Permalink
Add sitemap (#3035)
Browse files Browse the repository at this point in the history
* Add sitemap
* Remove PyTorch sphinx theme as submodule
* Exclude src/pytorch_sphinx_theme/docs from the build so that the html pages under don't appear on the site and in the sitemap
  • Loading branch information
svekars authored Sep 10, 2024
1 parent 8a8331e commit f1380d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .ci/docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

11 changes: 10 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
'sphinx_copybutton',
'sphinx_gallery.gen_gallery',
'sphinx_design',
'sphinx_sitemap'
]

intersphinx_mapping = {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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']

Expand Down

0 comments on commit f1380d3

Please sign in to comment.