Skip to content

Commit b7b9427

Browse files
committed
New [tool.repomatic] sphinx.builder config
1 parent 938cda4 commit b7b9427

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
run: >
6464
uv --no-progress run --frozen -- repomatic metadata
6565
--format github-json --output "$GITHUB_OUTPUT"
66-
is_python_project is_sphinx doc_files
66+
is_python_project is_sphinx doc_files sphinx_builder
6767
6868
deploy-docs:
6969
name: 📖 Deploy Sphinx doc
@@ -104,7 +104,12 @@ jobs:
104104
fonts-liberation graphviz mandoc
105105
- name: Build documentation
106106
# Install --all-extras so documentation can covers all features of the project, including the optional ones.
107-
run: uv --no-progress run --frozen --all-extras --group docs -- sphinx-build -b html ./docs ./docs/_build
107+
# The builder is `[tool.repomatic] sphinx.builder`, defaulting to `html`:
108+
# a project serving extension-less URLs sets it to `dirhtml`.
109+
run: >
110+
uv --no-progress run --frozen --all-extras --group docs --
111+
sphinx-build -b ${{ fromJSON(needs.metadata.outputs.metadata).sphinx_builder }}
112+
./docs ./docs/_build
108113
- name: Upload artifact
109114
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
110115
with:

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
> [!WARNING]
66
> This version is **not released yet** and is under active development.
77
8+
- New `[tool.repomatic] sphinx.builder` config choosing the Sphinx builder the Docs workflow deploys, so a project can publish extension-less URLs with `dirhtml`.
9+
810
## [`7.12.0` (2026-08-14)](https://github.com/kdeldycke/repomatic/compare/v7.11.0...v7.12.0)
911

1012
- New `ci-status` command reporting each workflow's latest run and which of its failing jobs gate a merge, read from jobs rather than run conclusions.

repomatic/config.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,25 @@ class Config:
10661066
enablement keys it owns into whatever the file already holds.
10671067
"""
10681068

1069+
sphinx_builder: str = field(
1070+
default="html",
1071+
metadata={CONFIG_PATH_METADATA_KEY: "sphinx.builder"},
1072+
)
1073+
"""Sphinx builder producing the deployed documentation site.
1074+
1075+
The default `html` writes `page.html`, so the site serves `/page.html`.
1076+
Setting it to `dirhtml` writes `page/index.html` instead, so the same page
1077+
serves at `/page/` and the published URLs carry no extension, which is the
1078+
shape search engines and most static hosts expect.
1079+
1080+
The one Sphinx setting a project cannot make in its own `conf.py`, hence a
1081+
config key: the builder is chosen on the command line, and `docs.yaml` is
1082+
what runs it. Switching an already-published site republishes every URL it
1083+
has: the old paths stop existing, so the repository's own absolute
1084+
self-links (readme, packaging specs) move in the same commit, and whatever
1085+
fronts the site redirects the old ones.
1086+
"""
1087+
10691088
test_matrix: TestMatrixConfig = field(
10701089
default_factory=TestMatrixConfig,
10711090
metadata={

tests/test_metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ def _tracked_inventory(
845845
"major_bump_allowed": AnyBool(),
846846
# `minimum-release-age` default "1 week", rendered as whole days for npm.
847847
"npm_min_release_age_days": 7,
848+
# This repository publishes `.html` pages, the `sphinx.builder` default.
849+
"sphinx_builder": "html",
848850
}
849851

850852

0 commit comments

Comments
 (0)