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 docs/ directory.
Alas, I originally put .nojekyll in the root folder, which did not do the trick. And then it took me some time to track down the underscore issue and link it back to jekyll.
Ah. Yes, it has to be in the root directory of the content being served by Github Pages, which I think would be wherever index.html is, regardless of how everything is setup. Good catch.