-
Notifications
You must be signed in to change notification settings - Fork 336
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
Article external image paths not converted properly #1620
Comments
Are you using the development version of pkgdown? (In general, supplying |
I was trying to make less work, but seems I veered in the wrong direction. My apologies. Noted for future issue submissions. I'm using the latest CRAN version of pkgdown (1.6.1). Our IT makes it difficult to install dev versions of packages. Reading through the NEWS, I didn't see anything that seemed related, but obviously you would know best. If you think there's something in there that might solve this, I can try to get it installed (certainly can try on my personal machine if nothing else). |
It appears the issue is caused by a space in the working directory path. I'll modify the steps to reproduce above to capture this. By adding a directory into the path with a space in the name, I could reproduce it on a separate machine. Removing the space and rebuilding had the path converted correctly. Unfortunately, I have less freedom remove spaces from the path on my work computer. As a side note, I noticed that when a broken link is created, it is only off by an additional parent directory reference. I.e., if I previewed the site and manually edited the |
Reading through this again, I'm pretty sure this is just the same case as #1472, or at least will be fixed when I ensure that you can use figures in |
This may be related to #1472, but the assets are being copied properly. The paths to the images appear to be not converted properly. I created a repo with sample files of the issue, but I'll also list the steps to recreate it at the end.
Issue summary: I'm trying to create a pkgdown site. My README and vignettes have external figures (i.e. images not created via R code). For the README, the external files are stored in
man/figures/
per thebuild_home
documentation. For the vignettes, the external files are located invignettes/
and are identified byrmarkdown::find_external_resources()
. Both the vignette and README build properly for the package. The README is rendered correctly for the home page of the pkgdown site, but the articles created from the vignettes have broken links to the external files (example).The image is copied to
docs/articles
but thesrc
attribute wasn't adjusted properly. Whereas for the README/home it's changed toreference/figures/README/image.png
, in the vignette/article it is converted to a some what convoluted relative path back to the vignette folder (which doesn't work even on my local computer). It issrc="../../../../Documents/Scripting/pkgdownReprex/vignettes/image.png"
instead of presumablyimage.png
.Here is my sessionInfo:
I managed to snag the temp test.utf8.md that gets fed into pandoc. The path is still listed as just "image.png" so the resolving the path is happening sometime after that.
If there isn't a way to correct the auto-translating of the src path, is there a way to force pkgdown to use embedded images similar to the
html_vignette
format (i.e. what's produced bydevtools::build_vignettes
)?Steps to create the sample repo:
Then edit the README to be this
Then edit
test.Rmd
to be this.End result is this site
The text was updated successfully, but these errors were encountered: