clerk

Drew Verlee 2024-07-12T20:55:11.927189Z

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)

Drew Verlee 2024-07-12T21:18:51.498319Z

i feel silly, this is likely the answer here... https://github.clerk.garden/

Drew Verlee 2024-07-12T21:28:22.719369Z

yeah! i was able to publish it easily with garden. Thanks garden!

💯 2
Drew Verlee 2024-07-12T04:17:19.666099Z

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?)

2024-07-12T07:25:00.287459Z

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.

teodorlu 2024-07-12T10:11:02.852219Z

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

Drew Verlee 2024-07-12T19:46:31.099269Z

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.

Drew Verlee 2024-07-12T19:53:12.288379Z

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")

Drew Verlee 2024-07-12T19:55:38.450169Z

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?

Drew Verlee 2024-07-12T19:57:07.024229Z

maybe the issue is i'm serving and building at the same time and one is overriding the other?

Drew Verlee 2024-07-12T20:25:05.824149Z

index.edn, as shown above, isnt' fetched, as shown in detail below via the browser headers tab:

Drew Verlee 2024-07-12T20:27:16.353909Z

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?

Drew Verlee 2024-07-12T20:36:06.421839Z

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.

Drew Verlee 2024-07-12T20:36:41.997779Z

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.

Drew Verlee 2024-07-12T20:54:18.626029Z

yep, if i save the files on s3 and make it a static site everything comes together.

👍 1
2024-07-13T08:37:26.279409Z

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.

👍 1