From 4c94c26166b2454cf69f72fde63d3cd74f61a274 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 2 Apr 2026 12:57:41 +0000 Subject: [PATCH] Fix Windows path bug: use relative --output-dir for quarto render Agent-Logs-Url: https://github.com/kv9898/pkgdown/sessions/1f4170a7-da79-4b03-bad2-8ba0d3b8ab5e Co-authored-by: kv9898 <105025148+kv9898@users.noreply.github.com> --- R/build-quarto-articles.R | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/R/build-quarto-articles.R b/R/build-quarto-articles.R index 33f01dbbb..fae44e5fd 100644 --- a/R/build-quarto-articles.R +++ b/R/build-quarto-articles.R @@ -107,12 +107,22 @@ quarto_render <- function(pkg, path, quiet = TRUE, frame = caller_env()) { ) write_yaml(quarto_format(pkg), metadata_path) - output_dir <- withr::local_tempdir("pkgdown-quarto-", .local_envir = frame) + # Create the output dir inside the source directory so that we can pass a + # relative path to quarto. This avoids a Windows-specific bug where Quarto + # (Deno) appends absolute paths with drive letters to the project root + # instead of treating them as absolute (e.g. path.join("E:\\src", "C:\\tmp") + # yields "E:\\src\\C:\\tmp" rather than "C:\\tmp"). + render_dir <- if (fs::is_dir(path)) path else fs::path_dir(path) + output_dir <- withr::local_tempdir( + "pkgdown-quarto-", + tmpdir = render_dir, + .local_envir = frame + ) quarto::quarto_render( path, metadata_file = metadata_path, - quarto_args = c("--output-dir", output_dir), + quarto_args = c("--output-dir", fs::path_rel(output_dir, start = render_dir)), quiet = quiet, as_job = FALSE )