From 69ec16045fc8a7c3053f7d0185ece556c6cfb85d Mon Sep 17 00:00:00 2001 From: Derek Ardolf <204508229+scriptautomate-bc@users.noreply.github.com> Date: Sat, 5 Sep 2026 00:02:48 +0000 Subject: [PATCH 1/2] feat(docs): add git-derived lastmod to sitemap and fix canonical URLs Bump sphinx-sitemap to 2.9.0 to pick up sitemap_show_lastmod, which sources from each page's git commit time via sphinx-last-updated-by-git. Move the en/latest/ path segment into html_baseurl and switch sitemap_url_scheme to {link} so rel=canonical tags resolve correctly instead of pointing at a 404. --- docs/conf.py | 8 ++++---- docs/requirements.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 4a8a3fe..2a364cd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -125,10 +125,10 @@ def setup(app): html_show_sourcelink = True # False on private repos; True on public repos html_theme = 'pydata_sphinx_theme' html_title = project -html_baseurl = 'https://docs.saltproject.io/salt/user-guide/' - -# Extends baseurl, in combination with version value -sitemap_locales = ['en'] +html_baseurl = 'https://docs.saltproject.io/salt/user-guide/en/latest/' +sitemap_url_scheme = "{link}" # lang/version now live in html_baseurl, so canonical is correct too +sitemap_locales = [None] # single-language site: drop redundant self-referential xhtml:link alternates +sitemap_show_lastmod = True # git commit time of each source .rst # Pages we don't care to include in generated sitemap file sitemap_excludes = [ "search.html", diff --git a/docs/requirements.txt b/docs/requirements.txt index 1e3d26d..5acbf15 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,6 +4,6 @@ sphinx-copybutton>=0.5.1 sphinx-design>=0.3.0 sphinx-inline-tabs>=2022.1.2b11 sphinx-prompt -sphinx-sitemap==2.6.0 +sphinx-sitemap==2.9.0 sphinx-tabs>=3.4.1 sphinx>=5.3.0 From 1efb512fcd76e9c476ba0ff5596e0bfd3a7a2d20 Mon Sep 17 00:00:00 2001 From: Derek Ardolf <204508229+scriptautomate-bc@users.noreply.github.com> Date: Sat, 5 Sep 2026 00:02:48 +0000 Subject: [PATCH 2/2] ci(docs): fetch full git history for sitemap lastmod generation The build job's checkout was depth-1, which causes sphinx-last-updated-by-git to either fail the build under -W or silently emit sitemap entries with no lastmod. Use fetch-depth: 0 with a blobless filter to keep the clone cheap while preserving commit history. --- .github/workflows/build-sphinx-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-sphinx-docs.yml b/.github/workflows/build-sphinx-docs.yml index 107a729..155bb40 100644 --- a/.github/workflows/build-sphinx-docs.yml +++ b/.github/workflows/build-sphinx-docs.yml @@ -26,6 +26,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + filter: blob:none - name: Setup Python uses: actions/setup-python@v5 with: