Skip to content

Conversation

@aidanfnv
Copy link
Contributor

@aidanfnv aidanfnv commented Aug 8, 2025

The ReadTheDocs site is supposed to highlight the current page in the table of contents, but this does not work if the URL is a directory. ReadTheDocs will automatically resolve the page to the index.html file in the directory, but the script for highlighting the page in the TOC will fail to find the page because the directory URL does not match the URL in the TOC, which ends in index.html.

Example, the page ...external/core-module-reference/ does not match ...external/core-module-reference/index.html in the TOC.

This updates the matching logic to compare the URLs again after appending index.html, if there is not already a match.

See an example of this working at https://shader-slanggithubio-aidanfnv-wip.readthedocs.io/en/fix-directory-url-toc-highlight/external/core-module-reference/

@aidanfnv aidanfnv requested a review from csyonghe August 8, 2025 22:49
@aidanfnv aidanfnv marked this pull request as ready for review August 8, 2025 22:49
@csyonghe csyonghe merged commit 58cda3b into shader-slang:main Aug 8, 2025
@aidanfnv aidanfnv deleted the fix/directory-url-toc-highlight branch August 8, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants