r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
721 stars 335 forks source link

pkgdown::deploy_to_branch creates malformed URLs #2816

Open jwimberl opened 1 week ago

jwimberl commented 1 week ago

The function pkgdown::deploy_to_branch modifes the URL provided by the user by extending it by the specified build subdirectory:

https://github.com/r-lib/pkgdown/blob/c40ba2c989e786bbb2829b431114d26375bbe19a/R/deploy-site.R#L147-L149

When the URL starts with a protocol, as it should, the fs::path method will replace the double forward slash with a single one, turning a valid URL like https://www.hostname.org into http:/www.hostname.org.

I think the behavior of automatically appending the subdir argument to the URL is also an issue:

jayhesselberth commented 1 week ago

Hmm, we might use httr2::url_build() here instead.