Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String "vignettes" in path to static images get replaced by "articles" #2810

Open
renozao opened this issue Nov 7, 2024 · 0 comments
Open

Comments

@renozao
Copy link
Contributor

renozao commented Nov 7, 2024

The issue:

  • under vignettes/: an file a_file.Rmd, with a chunk that includes a static image
knitr::include_graphics("../man/figures/vignettes/a/b/c/image.png")
  • a static image file under man/figures/vignettes/a/b/c/image.png

When building the site, I get the warning:

Missing images in vignettes/a_file.Rmd:
../reference/figures/articles/a/b/c/image.png
ℹ pkgdown can only use images in man/figures and vignettes
  • The generated HTML source indeed refers to ../reference/figures/articles/a/b/c/image.png
  • But, the actual image has been copied under ../reference/figures/vignettes/a/b/c/image.png

The cause:

Hence, it looks like there is some string substitution happening, which replaces "vignettes" by "articles", which in this case is incorrect or at least not consistent with where the image files are copied to.
I believe this happens here:

x <- gsub("(^|/)vignettes/", "\\1articles/", x, perl = TRUE)

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

No branches or pull requests

1 participant