New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
live-reloading #118
Comments
This would be possible in principle, but a bit tricky. For live reloading to work, you'd need some way to notify the browser when the file content changes. Right now the pages are static, so you'd have to wrap them with something that opens a WebSocket to the server and reloads the content. Personally, I tend to just use a MarkDown aware editor like MacDown when I write posts, and then look over them on the blog just to make sure everything looks right as the last step. |
Could be the following a couple of runnable options even if cryogen does not currently use CLJS?
What I'm looking for is something competitive with Hugo but using CLJ/CLJS instead of Go Language. To me the current issue with live-reloading is not while writing content, it's while creating themes. Imagine cryogen with a bunch of very nice themes and live reloading feature.... |
Reloading CSS live would be fairly easy using Figwheel. However, to reload individual tags on the page would be a bit with odds with the current design. Right now Cryogen uses static server side templates. Using ClojureScript for templating would require completely redesigning how that works unfortunately. So, the best you could do with the current approach is to reload the whole page when a change is detected. |
Hi, I think this can be done with Live reload extension on Chrome and Firefox + a live reload compatible server. The extension connects to the local server and will monitor files. If the files change, the server will update the extension and refresh. The live reload server can live inside clojure (easy setup, familiar) or outside - already available. inside clojure: https://github.com/bhurlow/clj-livereload/blob/master/example/clj_livereload/test.clj I have not tried any approach. I will try to make the clojure integration and submit a patch. My clojure Fu is weak though and if I don't make it - you won't see a reply here :). |
So, I've tested out clj-livereload with the example in the docs and it works ok for static files.
server clj
I have installed this Firefox extension: https://github.com/twolfson/livereload-extensions via I get this when the server starts:
I connect to it and then when I change the title I get 404 Page not found.
|
I have it working. Aditionally from what I mentioned above, I had commented out the
|
There are some issues with the current integration. I believe they are caused by the amount of writes done by cryogen. I believe the wipe triggers a reload notification for LiveReload and the compilation is not fast enough to generate the page before LiveReload does the reload. @lacarmen : Could we work without the wipe? Would plain file overwrite work? Also, I do hope that incremental compilation will make things work better: cryogen-project/cryogen-core#149 |
FYI https://github.com/metasoarous/toto has reportedly a very nice hot-blog reload |
Kind of available now soon: #242 |
Hello, thank so much for your hard work on this very appreciated project. One of the few things I miss, when compared with Hugo, is a live reloading of the resources in the browser when something changes in the src or in the resources/templates paths.
Do you have a smart idea on how I could eventually do this live-reloading (like figwheel for cljs or boot-realod with boot)?
Thanks!
The text was updated successfully, but these errors were encountered: