The PR-preview site that rossjrw/pr-preview-action deploys under /pr-preview/pr-<N>/ is built from altdoc/quarto_website.yml. Three knobs decide where its GitHub links go, and right now all three point at the main repo / main branch:
repo-url: (hardcoded to https://github.com/UCD-SERG/rpt) — drives quarto's repo-actions: [edit, source, issue] ("Edit this page", "View source").
repo-branch: (not set, so quarto defaults to main) — the branch portion of those URLs.
- The navbar
github icon's href: ($ALTDOC_PACKAGE_URL_GITHUB, substituted by altdoc from URL in DESCRIPTION) — just goes to the repo root.
For PR previews these should instead point at the PR/branch under review, so reviewers can click through to the right place. Proposed mapping:
repo-url: → https://github.com/<head_repo_full_name>
repo-branch: → <head_ref> (so "Edit this page" / "View source" lands on the right file in the right branch)
- Navbar GitHub icon
href: → https://github.com/<base_repo>/pull/<PR#> (the PR conversation page)
docs.yaml already has github.event.pull_request.head.repo.full_name, head.ref, and number available on PR builds. The change is a small step that rewrites those three values in altdoc/quarto_website.yml on disk before altdoc::render_docs() runs; non-PR builds leave the file untouched.
Tradeoff: this is an in-place CI rewrite, not a clean templating system — the template now has "this file is mutated in PR builds" semantics that someone reading the YAML cold won't see. A comment in quarto_website.yml next to the affected keys is enough to document it.
The PR-preview site that rossjrw/pr-preview-action deploys under
/pr-preview/pr-<N>/is built fromaltdoc/quarto_website.yml. Three knobs decide where its GitHub links go, and right now all three point at the main repo / main branch:repo-url:(hardcoded tohttps://github.com/UCD-SERG/rpt) — drives quarto'srepo-actions: [edit, source, issue]("Edit this page", "View source").repo-branch:(not set, so quarto defaults tomain) — the branch portion of those URLs.githubicon'shref:($ALTDOC_PACKAGE_URL_GITHUB, substituted by altdoc fromURLin DESCRIPTION) — just goes to the repo root.For PR previews these should instead point at the PR/branch under review, so reviewers can click through to the right place. Proposed mapping:
repo-url:→https://github.com/<head_repo_full_name>repo-branch:→<head_ref>(so "Edit this page" / "View source" lands on the right file in the right branch)href:→https://github.com/<base_repo>/pull/<PR#>(the PR conversation page)docs.yamlalready hasgithub.event.pull_request.head.repo.full_name,head.ref, andnumberavailable on PR builds. The change is a small step that rewrites those three values inaltdoc/quarto_website.ymlon disk beforealtdoc::render_docs()runs; non-PR builds leave the file untouched.Tradeoff: this is an in-place CI rewrite, not a clean templating system — the template now has "this file is mutated in PR builds" semantics that someone reading the YAML cold won't see. A comment in
quarto_website.ymlnext to the affected keys is enough to document it.