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

Include arbitrary files #2064

Closed
josherrickson opened this issue Mar 26, 2022 · 8 comments
Closed

Include arbitrary files #2064

josherrickson opened this issue Mar 26, 2022 · 8 comments
Labels
deploy ✈️ feature a feature request or enhancement
Milestone

Comments

@josherrickson
Copy link

josherrickson commented Mar 26, 2022

Am I missing an automatic way to flag specific files which should be included in the built site? I'm trying to use the pkgdown site as a drat repository, and since pkgdown cleans the gh-pages branch on every rebuild, I'm having to manually add the files back.

Specifically, I need to place some files in bin/ and src/contrib/. I have these on my main branch, and ideally I'd like some way to tell pkgdown to just copy those locations/files directly over to gh-pages.

@vincentarelbundock
Copy link

Not sure if this will help, but I have a repo + pkgdown website where I host arbitrary files:

https://github.com/vincentarelbundock/Rdatasets/

What I do is basically:

  • commit the files to the gh-pages branch
  • deploy with pkgdown::deploy_to_branch(clean = FALSE)

Note the important clean argument.

The specific steps I take are listed in a reminder at the bottom of my README, but they are repo-specific.

@josherrickson
Copy link
Author

Thanks - I do something similar right now but its helpful to see another example!

Where this falls down for me is needing to do clean = FALSE. This could lead to a lot of cruft building up in gh-pages. I'm OK with pkgdown cleaning out the existing gh-pages, I just want to be able to flag files that pkgdown copies over automatically, after cleaning out the existing.

@MLopez-Ibanez
Copy link

Indeed, we have a similar problem. We want to make available in the website a vignette that can only be built in PDF and we have to run a quite complicated sequence of commands:

https://github.com/MLopez-Ibanez/irace/blob/f8c50f9cc18c4a4c1d96b7e0bf1b95d0417ec5a4/.github/workflows/R-CMD-check.yaml#L193-L218

@hadley hadley added feature a feature request or enhancement deploy ✈️ labels May 31, 2022
@hadley
Copy link
Member

hadley commented May 31, 2022

Seems like it would be reasonable to include some config that let you declare paths as "known" and not to be cleaned up.

@hadley hadley changed the title include arbitrary files Include arbitrary files May 31, 2022
@hadley
Copy link
Member

hadley commented Apr 17, 2024

Alternatively we could have a convention like where all files in pkgdown/include are copied to the root directory of the package site.

@hadley hadley added this to the 2.1.0 milestone Apr 22, 2024
@hadley
Copy link
Member

hadley commented Apr 25, 2024

Actually, template packages use inst/pkgdown/assets/, so would probably make the most sense to copy pkgdown/assets to the docs destination dir.

@hadley
Copy link
Member

hadley commented Apr 25, 2024

Oh, and indeed the code to do that already exists 😬

@hadley
Copy link
Member

hadley commented Apr 25, 2024

And it's already documented in https://pkgdown.r-lib.org/articles/customise.html#additional-html-and-files, so I'm going to close this issue 😄

@hadley hadley closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy ✈️ feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants