Skip to content

Commit 33d2ee2

Browse files
authored
docs: Add sphinx-sitemap generation to Python doc (#5331)
Added sitemap for Sphinx docs using the sphinx-sitemap extension to address part of issue #5321. Includes the corresponding change in CI. The results are a basic sitemap with each URL. Leaving out pages according to the example in documentation. Not including lastmod which is in our current site maps because this is not currently supported by Sphinx (but in it is works).
1 parent 9175c5f commit 33d2ee2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
154154
- name: Build Sphinx documentation
155155
run: |
156-
pip install sphinx
156+
pip install sphinx sphinx-sitemap
157157
cd grass
158158
make sphinxdoclib
159159
ARCH="$(grass --config arch)"

python/grass/docs/conf.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"sphinx.ext.mathjax",
113113
"sphinx.ext.ifconfig",
114114
"sphinx.ext.viewcode",
115+
"sphinx_sitemap",
115116
]
116117

117118
# Add any paths that contain templates here, relative to this directory.
@@ -135,7 +136,7 @@
135136
# built documents.
136137
#
137138
# The short X.Y version.
138-
# version = '0.1'
139+
version = grass_version
139140
# The full version, including alpha/beta/rc tags.
140141
# release = '0.1'
141142

@@ -431,3 +432,14 @@
431432

432433
# Where class documentation comes from (class or __init__ docstring).
433434
autoclass_content = "both"
435+
436+
# sphinx-sitemap extension config
437+
# https://sphinx-sitemap.readthedocs.io/en/latest/advanced-configuration.html
438+
sitemap_filename = "sitemap.xml"
439+
html_baseurl = "https://grass.osgeo.org/"
440+
sitemap_url_scheme = "grass{version}manuals/libpython/{link}"
441+
442+
sitemap_excludes = [
443+
"search.html",
444+
"genindex.html",
445+
]

0 commit comments

Comments
 (0)