mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 09:38:33 -05:00
PDF and EPUB links in dev build point to main site instead of dev version #451
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @profvjreddi on GitHub (Nov 1, 2025).
Originally assigned to: @profvjreddi on GitHub.
I realized that when the dev build is built, the links for the PDF and EPUB are actually pointing to the main site and not the dev version. This could lead to mistaken assumptions that everything is working correctly on the dev build, when in fact the links are not valid for the development environment.
Dev
Steps to reproduce:
Expected behavior:
Links in the dev build should point to the dev version of the PDF and EPUB, not the main site.
Impact:
This makes it easy to miss issues with the dev build's PDF/EPUB output.
Suggested fix:
Update the build logic so that links in the dev environment point to dev artifacts.
@siddu1324 commented on GitHub (Nov 3, 2025):
Hi @profvjreddi 👋
I went through all three Quarto configuration files (_quarto-html.yml, _quarto-epub.yml, and _quarto-pdf.yml), and I didn’t find a site-url key being defined anywhere. Instead, the links in the HTML navbar are hardcoded to production URLs — for example:
This means the dev and preview builds always point to mlsysbook.ai, regardless of environment.
To fix this, I can:
Would it be okay if I implement that and open a PR for review?
@profvjreddi commented on GitHub (Nov 4, 2025):
Hi @siddu1324, that would be great! However, the issue goes beyond just fixing the relative paths, which I agree we need to do. We also need to update the validate-dev GitHub workflow to properly package the build artifacts, and then the deploy preview workflow must take those artifacts and push them up. That's the real challenge.
If you examine the GitHub workflows I have set up, you'll see that they are quite complex. 😓 Once I get that working, it will definitely be helpful. I was planning to do this over the Christmas break because most people don't typically look at the
devbranch outside of me.Feel free to take a look and see if you think you can handle it, but don’t worry if it seems too messy; I know it can be difficult to understand what I've got going on.
@siddu1324 commented on GitHub (Nov 4, 2025):
Got it, thanks for the context @profvjreddi ! That makes total sense, I had a feeling the workflows might be the tricky part 😅
Sure, Prof! I’ll start by looking into the CI/CD setup and see how the validate-dev and deploy preview workflows are structured. I’ll also try tackling the path logic first to get that part working cleanly, and then I’ll let you know if I feel comfortable handling the rest.
Appreciate the heads-up — I’ll take a look and keep you posted!
@profvjreddi commented on GitHub (Nov 5, 2025):
Thanks a bunch @siddu1324 🙏
@profvjreddi commented on GitHub (Nov 6, 2025):
@siddu1324 I fixed it. Could you please take a look, just so that I have a different set of eyes on it?