You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the present, there is nothing stopping us from making each blog post an renv project, but apart from blogdown not actually using the renv environment (#469), there are a few small gotchas.
You really need to add the renv directory to your ignoreFiles list. Without this, Hugo will traverse the renv tree during its site build, and inevitably choke on the first HTML file it encounters there.
You probably want to add the renv.lock file to your ignoreFiles list. If we don't Include renv.lock in ignoreFiles Hugo will publish that file alongside your HTML file, which is usually not desirable.
ignoreFiles:
- "\\.Rmd$"
- "\\.Rmarkdown$"
- "\\.Rproj$"
- "\\.RData$"
- "\\.Rhistory$"
- "\\.Rnw$"
- "\\.pdf$"
- "\\.sqlite.*$"
- "_cache$"
- "\\.knit\\.md$"
- "\\.utf8\\.md$"
- "renv" # if you're on blogdown v0.21+, don't use any trailing slash!
- "renv\\.lock$"
blogdown::build_site(...) now knows to skip the renv tree (note that this is hard-coded, and not dependent on your ignoreFiles), but blogdown::check_site() still peruses the renv/ tree inside each blog post, which makes it unnecessarily chatty (but does not really break anything), for example:
― Checking content files
| Checking for validity of YAML metadata in posts...
● [TODO] Found invalid YAML metadata in the following files:
content/post/2015-02-07-rod-with-conformal-layer/renv/library/R-4.0/x86_64-pc-linux-gnu/tikzDevice/NEWS.md (Reason: Scanner error: while scanning a simple key at line 4, column 1 could not find expected ':' at line 5, column 1
)
Please fix the YAML metadata of these files.
[...]
● [TODO] Found 221 incompatible .html files introduced by previous blogdown versions:
### [I am purposely not showing all 221 rows here...]
file.remove(c(
"content/post/2014-09-13-xray-line-energies/renv/library/R-4.0/x86_64-pc-linux-gnu/ggplot2/doc/ggplot2-specs.html",
"content/post/2015-03-20-sem-tiffinfo/renv/library/R-4.0/x86_64-pc-linux-gnu/tibble/doc/formats.html",
"content/post/2019-01-20-rstudio-server-multiple-instances-kvm/renv/library/R-4.0/x86_64-pc-linux-gnu/knitr/examples/knitr-spin.html",
"content/post/2020-11-17-measurement-errors/renv/library/R-4.0/x86_64-pc-linux-gnu/units/doc/measurement_units_in_R.html"
))
To fix, run the above command and then blogdown::build_site(build_rmd = "newfile").
If you, like me, are interested in using renv together with blogdown, I suggest you start by skimming through issues #451 and #469. Thanks to @cdervfor asking me to collect my thoughts on the subject into one issue. I hope this does not confuse the subject.
The text was updated successfully, but these errors were encountered:
Both problems mentioned in this issue should be fixed now: check_config() will suggest ignoring renv and renv.lock, and check_content() will ignore renv folders. Thank you very much!
At the present, there is nothing stopping us from making each blog post an renv project, but apart from blogdown not actually using the renv environment (#469), there are a few small gotchas.
You really need to add the
renv
directory to yourignoreFiles
list. Without this, Hugo will traverse therenv
tree during its site build, and inevitably choke on the first HTML file it encounters there.You probably want to add the
renv.lock
file to yourignoreFiles
list. If we don't Includerenv.lock
inignoreFiles
Hugo will publish that file alongside your HTML file, which is usually not desirable.blogdown::build_site(...)
now knows to skip therenv
tree (note that this is hard-coded, and not dependent on yourignoreFiles
), butblogdown::check_site()
still peruses therenv/
tree inside each blog post, which makes it unnecessarily chatty (but does not really break anything), for example:If you, like me, are interested in using renv together with blogdown, I suggest you start by skimming through issues #451 and #469. Thanks to @cderv for asking me to collect my thoughts on the subject into one issue. I hope this does not confuse the subject.
The text was updated successfully, but these errors were encountered: