Skip to content

Commit 2a6fdae

Browse files
committed
docs(build): switch from html to dirhtml builder for clean URLs
why: The html builder generates relative paths like ../index.html and # that go stale after SPA navigation across directory depths. The dirhtml builder generates clean URLs natively (/api/ instead of /api/index.html). what: - Change html, start, and design recipes to use -b dirhtml - sphinx-autobuild serves dirhtml correctly (StaticFiles html=True) - SPA nav already handles / endings (shouldIntercept checks endsWith("/")) - rediraffe supports dirhtml natively (DirectoryHTMLBuilder detection) - No changes needed to redirects.txt, conf.py, or documentation source
1 parent 3c1d061 commit 2a6fdae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ default:
2323
# Build HTML documentation
2424
[group: 'build']
2525
html:
26-
{{ sphinxbuild }} -b html {{ allsphinxopts }} {{ builddir }}/html
26+
{{ sphinxbuild }} -b dirhtml {{ allsphinxopts }} {{ builddir }}/html
2727
@echo ""
2828
@echo "Build finished. The HTML pages are in {{ builddir }}/html."
2929

@@ -198,9 +198,9 @@ dev:
198198
# Start sphinx-autobuild server
199199
[group: 'dev']
200200
start:
201-
uv run sphinx-autobuild "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }}
201+
uv run sphinx-autobuild -b dirhtml "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }}
202202

203203
# Design mode: watch static files and disable incremental builds
204204
[group: 'dev']
205205
design:
206-
uv run sphinx-autobuild "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }} --watch "." -a
206+
uv run sphinx-autobuild -b dirhtml "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }} --watch "." -a

0 commit comments

Comments
 (0)