Where can I put a static file in Beaker notebook so that my HTML can find it?

46 Views Asked by At

Where can I put an image or other static file in Beaker so that my HTML can find it? And will this image work if I share the notebook with someone else?

1

There are 1 best solutions below

0
JMeinwald On

Put them in ~/.beaker/v1/web, and then from your HTML and JS you can refer to it with /user. For example if you have an image at ~/.beaker/v1/web/foo.jpg you can use it with img src="/user/foo.jpg">. See the tutorial.

Note that if you do this, the images will not work if you share the notebook with someone else. We are planning on a better solution for this, see Issue #430.