Skip to content

Commit

Permalink
Fix toctree navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-linaro committed Sep 19, 2024
1 parent adc172d commit c16a59c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sphinx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The Sphinx documentation toolchain."""

__version__ = '8.1.0+Linaro-240919b'
__version__ = '8.1.0+Linaro-240919c'
__display_version__ = __version__ # used for command line version

# Keep this file executable as-is in Python 3!
Expand Down
6 changes: 5 additions & 1 deletion sphinx/environment/adapters/toctree.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ def _resolve_toctree(
# generation time)
for refnode in newnode.findall(nodes.reference):
if url_re.match(refnode['refuri']) is None:
rel_uri = builder.get_relative_uri(docname, refnode['refuri'])
# PJC: Now that osutil/relative_uri accommodates / navigation in
# calculating the relative uri, this *doesn't* work for the navigation
# sidebar, so we deliberately pass "" instead of docname, just to get
# the correct URI back.
rel_uri = builder.get_relative_uri("", refnode['refuri'])
refnode['refuri'] = rel_uri + refnode['anchorname']
return newnode

Expand Down

0 comments on commit c16a59c

Please sign in to comment.