Whats everyones favorite place for hosting their clerk notebooks online? s3? something else? (im aware this isn't very clerk specific, but i'm curious what this community leans towards)
i feel silly, this is likely the answer here... https://github.clerk.garden/
yeah! i was able to publish it easily with garden. Thanks garden!
Can someone help me connect the dots between running a notebook local, and deploying a static site with the same content (i assume just images, in the case where some backend library is used). I see i have a public folder, and but it contains a index.edn, which obviously, isn't going to help, and a index.html, which doesn't seem to have the content (or maybe it does?)
The html file loads the EDN via JS to present the notebook. You should be able to put it behind a webserver and load the page.
Here's an example of what Jack explains: • Rendered page: https://play.teod.eu/clojure-easy-parallellism-with-pipeline-blocking/ • Source folder: https://github.com/teodorlu/play.teod.eu/tree/bc6d1d28ba1ff2bace112a228f70cc08f16824a8/clojure-easy-parallellism-with-pipeline-blocking The play.edn file is unrelated to clerk, it's where I put my own metadata. How this looks is going to be a bit different if you're serving one page generated with clerk, or if you're serving multiple clerk pages with a clerk-generated index. Relevant docs: https://book.clerk.vision/#static-building
I assumed if i used chrome to open the index.html it would display the static site, instead it displays nothing and the browser Console is telling me it failed to fetch the edn. here is the error: > Access to fetch at 'file:///home/drewverlee/personal/bugs/public/build/index.edn' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted. I'm assuming this would happen if i put the index.html and index.edn on s3 and configured it to be a static site, so i'm still not sure i'm on the happy path.
the questions i have, that i probably should know the answers to are: 1. why is this cross origin if i'm reading my own filesystem? 2. what is the current origin of the page 3. What origin of the thing severing it (is that the "null")
backing up, do i need a live jvm process running clerk/build! in order to "serve" the content? Or clerk/build! going to "build" a html file that i can hand browsers and it will properly display the content?
maybe the issue is i'm serving and building at the same time and one is overriding the other?
index.edn, as shown above, isnt' fetched, as shown in detail below via the browser headers tab:
still not sure thats actual an issue given what i want to do, just odd because, if you clerk build and want to browse, it does open the index.html and fails to fetch the index.edn
(clerk/build! {:paths ["src/drewverlee/bugs.clj"] :browse true} )
So this would seem to be the intended behavior, but i don't know why it would be useful?
Maybe the origin of the ... page should be set to my computer and it's not?yea, without telling the browser (through a flag at startup) that you can open files it seems like it won't. So i'm curious what the option :browse true is good for? Asking because its presence implies im confused, as it doesn't seem that useful to browse the built files.
but this should work on s3. Im not sure why i though to try it on my computer first? I didn't do that with cyrogen.
yep, if i save the files on s3 and make it a static site everything comes together.
The cross site stuff is security gunk in chrome (and other modern browsers). You need to run a local web server via, for example, python -m http.server 8000 to view the static bundle locally.