Danny Watts
Danny Watts

Reputation: 579

Clojure website to html and javascript?

The question is: is there a way to get or compile a website written in clojure to HTML and Javascript files without having .WAR file for the server? Thank you.

Upvotes: 2

Views: 235

Answers (2)

Naim Suleymanoglu
Naim Suleymanoglu

Reputation: 31

If you want to create a static site, there are couple of options,

Upvotes: 3

Arthur Ulfeldt
Arthur Ulfeldt

Reputation: 91607

For that you may want to look into writing the site in ClojureScript. It's a different language though very similar to Clojure. This would make it possible to write the entire site using client side java script and static resources like HTML, CSS, Images, etc. Or you could use node to run the generated server side JavaScript.

Another option, depending on how I interpret your question would be to write it as a dynamic site in Clojure, then spider the whole thing using wget and save a static snapshot of it. Though perhaps that's not what you where asking for? You could also use Hickup or Enlive to create templates and then run the templates to produce html that you serve statically with no app server or dynamic content.

Upvotes: 3

Related Questions