[GH-ISSUE #1795] [Bug] MLSysBook Vol. I: Clicking on figure to enlarge does not work #27937

Closed
opened 2026-06-20 11:57:02 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @asgalon on GitHub (May 22, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1795

Area

Book — Volume I

Location

ML Workflow

Description

Clicking on a figure does not work:

Image Image

Opening the link in a new tab shows:

Image

Expected Behavior

Should probably show an enlarged version of the illustration?

Environment (TinyTorch bugs only)

No response

Originally created by @asgalon on GitHub (May 22, 2026). Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1795 ### Area Book — Volume I ### Location ML Workflow ### Description Clicking on a figure does not work: <img width="1781" height="709" alt="Image" src="https://github.com/user-attachments/assets/bced3783-febf-4c53-93fd-b3d56a46a2a1" /> <img width="1781" height="949" alt="Image" src="https://github.com/user-attachments/assets/1f0482f3-aaf1-4fac-9e54-4ac170a1505b" /> Opening the [link](https://mlsysbook.ai/vol1/contents/vol1/ml_workflow/3b022a3ffa6f028fe2c2c3165c292a16a3a9e0ff.svg) in a new tab shows: <img width="1781" height="949" alt="Image" src="https://github.com/user-attachments/assets/e17e7414-79a0-41fc-a808-9270e60fefd4" /> ### Expected Behavior Should probably show an enlarged version of the illustration? ### Environment (TinyTorch bugs only) _No response_
GiteaMirror added the area: booktype: bug labels 2026-06-20 11:57:03 -05:00
Author
Owner

@asgalon commented on GitHub (May 22, 2026):

Nice error message btw :-)

<!-- gh-comment-id:4518368818 --> @asgalon commented on GitHub (May 22, 2026): Nice error message btw :-)
Author
Owner

@asgalon commented on GitHub (May 22, 2026):

The URL really used for the download in the page is:
3b022a3ffa.svg
while the a link url is:
3b022a3ffa.svg

so the ml_workflow_files/mediabag path element is missing.

<!-- gh-comment-id:4518412137 --> @asgalon commented on GitHub (May 22, 2026): The URL really used for the download in the page is: https://mlsysbook.ai/vol1/contents/vol1/ml_workflow/ml_workflow_files/mediabag/3b022a3ffa6f028fe2c2c3165c292a16a3a9e0ff.svg while the a link url is: https://mlsysbook.ai/vol1/contents/vol1/ml_workflow/3b022a3ffa6f028fe2c2c3165c292a16a3a9e0ff.svg so the ml_workflow_files/mediabag path element is missing.
Author
Owner

@profvjreddi commented on GitHub (May 25, 2026):

Root cause identified and fixed. Quarto's lightbox feature generates a wrong <a href> for images stored in the mediabag directory — the href uses the bare hash filename (e.g., 3b022a3f...svg) while the actual file lives at chapter_files/mediabag/3b022a3f...svg. The <img src> inside the anchor is correct; only the lightbox click-to-enlarge link was broken.

Fix: Added a fix_lightbox_mediabag.py post-render script that rewrites each lightbox <a href> to match the child <img src> path. Wired into both vol1 and vol2 HTML build configs.

Impact: Fixes 210 broken figure-click links across 30 chapter HTML files in both volumes. Will be live on next deploy.

Thanks for the report @asgalon!

<!-- gh-comment-id:4534969949 --> @profvjreddi commented on GitHub (May 25, 2026): Root cause identified and fixed. Quarto's lightbox feature generates a wrong `<a href>` for images stored in the mediabag directory — the href uses the bare hash filename (e.g., `3b022a3f...svg`) while the actual file lives at `chapter_files/mediabag/3b022a3f...svg`. The `<img src>` inside the anchor is correct; only the lightbox click-to-enlarge link was broken. **Fix:** Added a `fix_lightbox_mediabag.py` post-render script that rewrites each lightbox `<a href>` to match the child `<img src>` path. Wired into both vol1 and vol2 HTML build configs. **Impact:** Fixes 210 broken figure-click links across 30 chapter HTML files in both volumes. Will be live on next deploy. Thanks for the report @asgalon!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#27937