Skip to content

Commit b74c565

Browse files
committed
🔧 Add sphinx sitemap
1 parent 899e4fb commit b74c565

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

docs/conf.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import os
2323
import re
2424

25-
# Set canonical URL from the Read the Docs Domain
26-
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
25+
# Set canonical URL for the sitemap
26+
html_baseurl = "https://python4data.science/en/latest/"
2727

2828
html_context = {}
2929
# Tell Jinja2 templates the build is running on Read the Docs
@@ -54,6 +54,7 @@
5454
"sphinx.ext.todo",
5555
"sphinx_copybutton",
5656
"sphinx_inline_tabs",
57+
"sphinx_sitemap",
5758
"sphinxcontrib.cairosvgconverter",
5859
"sphinxext.opengraph",
5960
]
@@ -246,3 +247,13 @@ def setup(app):
246247
# -- graphviz configuration --------------------------------------------------
247248

248249
graphviz_output_format = "svg"
250+
251+
# -- sitemap configuration ---------------------------------------------------
252+
253+
sitemap_url_scheme = "{link}"
254+
sitemap_excludes = [
255+
"404.html",
256+
"search.html",
257+
"genindex.html",
258+
]
259+
sitemap_show_lastmod = True

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ docs = [
2626
"sphinx-copybutton",
2727
"sphinx-lint",
2828
"sphinx-notfound-page",
29+
"sphinx-sitemap",
2930
"sphinx_inline_tabs",
3031
"sphinxcontrib-svg2pdfconverter",
3132
"sphinxext.opengraph", # matplotlib is required for social cards

0 commit comments

Comments
 (0)