This issue was raised earlier:
But the solution didn't work for me (late 2020), so I'm sharing my own here.
Issue: bookdown saves images generated by the R code to a directory called
/_main_files/figure-html. However, GitHub's default site generator jekyll ignores all directories starting with an underscore (_), so the image links broke when I tried to view the site online.
Solution: The problem can be solved by adding an empty file to the directory called
.nojekyll, which disables jekyll. This works for us, since bookdown already generates a standalone site and doesn't need jekyll. What helped me specifically was adding
.nojekyll to the same directory as the
index.html file - usually it's the
Hope this is useful.