Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AdamFrey/clojure-html-server-live-reload-template
Template for setting up automatic reload for Clojure server-rendered HTML.
https://github.com/AdamFrey/clojure-html-server-live-reload-template
Last synced: 12 days ago
JSON representation
Template for setting up automatic reload for Clojure server-rendered HTML.
- Host: GitHub
- URL: https://github.com/AdamFrey/clojure-html-server-live-reload-template
- Owner: AdamFrey
- Created: 2023-08-26T19:04:52.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-03T00:59:06.000Z (about 1 year ago)
- Last Synced: 2024-10-15T20:33:23.462Z (28 days ago)
- Language: Clojure
- Size: 19.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Clojure Live Reload HTML Server Template
Automatic browser live reload for Clojure server rendered HTML. A
Figwheel/shadow style experience, but without ClojureScript.Note that this functionality can also be achieved with the [ring-refresh](https://github.com/weavejester/ring-refresh) library which I wasn't aware of when I first published this project. See note in [alternatives](#Alternatives).
This template will generate a starting-point project for a clojure server that
serves Hiccup-based HTML and CSS with live reload functionality. Your browser
tab will reload automatically when you re-evaluate the namespaces with your
hiccup clojure code and when your CSS files are saved.See [introductory blog post](https://adamfrey.me/blog/post/clj-live-reload-template-release) for more information.
## Usage
This is a template project for use with [deps-new](https://github.com/seancorfield/deps-new).
To use it, first make sure you have installed `deps-new` as your `new` "tool" via:
```bash
clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.13"}' :as new
```Then replace `yourcorp/app-name` with your desired application name and run:
``` bash
$ clojure -Sdeps '{:deps {io.github.adamfrey/clojure-html-server-live-reload-template {:git/sha "4bc908f5d601e2ba24c477f7bc123e83f89635a3"}}}' -Tnew create :template afrey/html_server_live_reload_template :name yourcorp/app-name
```Next, open up the `README.md` file in the newly created project for more information on usage.
## Alternatives
- [ring-refresh](https://github.com/weavejester/ring-refresh) - has been around for much longer than this project and is quite arguably a more elegant middleware-based approach to the problem. `ring-refresh` uses timeouts instead of websockets for reload notifications.
- [panas.reload](https://github.com/keychera/panas.reload) appears to aim for a similar goal, uses babashka## License
Copyright © 2023 Adam Frey
Distributed under the Eclipse Public License version 1.0.