fix: sidebar parent link does nothing on product sub-pages#144
fix: sidebar parent link does nothing on product sub-pages#144pmigueld wants to merge 3 commits into
Conversation
The clean-URL post-processing in `update_html_files` stripped the trailing `index.html` from internal links via `href[:-10]`. For a bare same-directory link (`href="index.html"`) this produced an empty string, which the browser resolves to the current page. As a result, clicking a section's parent entry in the sidebar (e.g. a product name, from one of its sub-pages) did nothing instead of returning to the section index. Fall back to "./" when stripping would leave an empty href, so the link still points at the directory index. This only runs on the production build (gated by SPHINX_DEV_BUILD), which is why it surfaced on the live site. Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates the HTML post-processing logic in docs/conf.py to ensure that internal links ending with 'index.html' collapse to './' instead of an empty string, preventing broken self-referencing links. The reviewer identified a critical issue where this logic could incorrectly match and mangle other files ending in 'index.html' (such as 'genindex.html'), leading to 404 errors, and provided a code suggestion to safely restrict the matching criteria.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|



Problem
On the live docs (v2.0): expand Products → click a product (e.g. SP-MIS) → click a sub-page (e.g. Modules included) → click the product name again. Expected: return to the product index. Actual: nothing happens, you stay on the sub-page.
Root cause
Not the theme. The clean-URL post-processing hook
update_html_filesindocs/conf.pystrips a trailingindex.htmlfrom internal links:sphinx-buildemits the parent link ashref="index.html"(same directory)."index.html"[:-10] == "", and an empty href resolves to the current page — so the link does nothing. Sibling/ancestor links keep a path prefix (../social_registry/index.html→../social_registry/) and are unaffected.The hook is gated by
SPHINX_DEV_BUILD, so it runs only on the production/deploy build — which is why the bug appears on the live site but not inmake livehtml.Fix
Fall back to
./when stripping would leave an empty href:./resolves to the directory index, fixing every section (not just products).Verification
Reproduced the production build locally (full build without
SPHINX_DEV_BUILDso the hook runs):href=""; click did nothing.href="./". Served the build and drove headless Chrome — clicking OpenSPP SP-MIS on/products/spmis/modules_included.htmlnavigates to/products/spmis/. Confirmed.🤖 Generated with Claude Code