rmarkdown icon indicating copy to clipboard operation
rmarkdown copied to clipboard

render_site (how to hardcode images)

Open ChenDepp opened this issue 1 year ago • 2 comments

hi everyone: I use render_site to generate my html website but I want to include all dependencies in the html, can you tell me how to achieve it? waiting for your reply, have a good day!

ChenDepp avatar Jul 15 '24 03:07 ChenDepp

The html_document() has self_contained option - maybe can try it.

uzsolt avatar Jul 19 '25 07:07 uzsolt

Yes, this should work, though it will create a very heavy website. The advantage of a website is to have shared dependencies, with .html in a folder and a common libs path accessed by all .html.

If every HTML is self-contained, each file will be very heavy.

This is not common usage so I don't know if there is side effect, you could try it.

Out of curiosity, why do you want all deps to be included? If you do a website, you will have several html files anyway, so you'll need to deploy a folder. Why not deploy the lib folder with the other files ?

cderv avatar Jul 25 '25 08:07 cderv