So there are some vignettes that are built on CRAN, and some that are specific to the pkgdown website. All of the vignettes and articles use the vignettes/bib/references.bib and vignettes/bib/apa.csl files, and ideally, I would have just one copy of each file that can be referenced by all Rmd files (as in the current structure).
In the YAML of the articles, I have code like:
bibliography: ../bib/references.bib
When I build the pkgdown site locally, this works without issue. However, when the site attempts to build on GitHub actions, I get an error: File ../bib/apa.csl not found in resource path. Is there something special I need to do in order to be able to reference files in the articles YAML that are from a parent directory?
I'd recommend creating a reproducible example of a smaller package.
For what it's worth, I can reproduce the error using simply pkgdown::build_articles():
Caused by error in `render_rmarkdown()`:
! Failed to render RMarkdown document.
✖ File ../../bib/apa.csl not found in resource path There were 12 warnings
(use warnings() to see them)
Interestingly, when I was creating the minimal example, I noticed that articles directly under articles (e.g., articles/article1.Rmd) rendered just fine with bibliography: ../bib/references.bib.
It was only when I added an extra level of nesting that things broke.
It's not strictly necessary, but it just help keep me organized. There are only a few vignettes in the actual repo right now, but I'm planning to add several more. Originally, it made sense to me to keep the different types of articles in different folders (e.g., general purpose in the main articles directory, specific types of use cases in sub-directories). But if it's a choice between having a single .bib file or having subdirectories, I'd rather have a single .bib file .