0

After my bookdown project grew too large, I have installed git lfs, so now my images are stored as pointers. However, this way they are not rendered correctly with github pages.

I have seen this solution (that is, to update links manually), but the problem is that

  • with external links the command "build all" exits with a mistake (discussion here: "Basically graphics from the web will no longer work for PDF output").
  • some of the images are produced while knitting, e.g. graphs and diagrams, and I do not indicate their location at all (normally).

Is there some solution to make lfs work with pages without manually fixing the links to all the images?

  • I removed the [tag:r] tag since the problem seems unlikely to be related (even though you're using R with `bookdown`). I believe any solution will be in git/github and not in R. (If I'm wrong, my apologies!) – r2evans Jul 14 '23 at 17:07

1 Answers1

0

Ok, I think I can now answer my own question -- in case anyone else faces the same problem.

  1. No, LFS does not work with pages. So it is advisable to avoid storing too many large files in your repo if you plan to launch a pages website.

  2. To enable external urls for your bookdown project, you should disable pdf format. Just leave gitbook as the only format. This can be done by editing the .yml files in your project folder.

After that, just store your pictures in a cloud and use external urls, with no need to store pictures etc. locally.