Skip to content

fix: keep url scheme when deploy_to_branch() uses subdir - #3024

Open
taekop wants to merge 1 commit into
r-lib:mainfrom
taekop:fix-deploy-subdir-url
Open

taekop wants to merge 1 commit into
r-lib:mainfrom
taekop:fix-deploy-subdir-url

Conversation

@taekop

@taekop taekop commented Oct 5, 2026

Copy link
Copy Markdown

deploy_to_branch() appends subdir to the site url with fs::path(), which collapses the // after the scheme. A url of https://example.org/demo with subdir = "v1" ended up as https:/example.org/demo/v1, and that value ended up in the built site's pkgdown.yml.

The two parts are now joined with a single /. Only URLs that have a scheme change: for the 56 url/subdir combinations I compared before and after, the old and new values were identical except that https:/ became https:// (schemeless and local-path values are unchanged). Trailing slashes on url and leading/trailing slashes on subdir are still normalised as before.

I did not change the behaviour of appending subdir to url at all, since the issue also questions that and it looks like your call.

The new test runs deploy_to_branch(subdir = "v1") against a local bare remote and checks the URLs written to pkgdown.yml on the gh-pages branch. It fails without the fix and passes with it. On my machine the rest of the suite gives the same 12 failures on main and on this branch (the quarto article tests, which need the quarto package, plus the build_article error snapshot, the tutorials test and the figure test).

Part of #2816

This branch has not been deployed

No deployments
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.

1 participant