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.
-
1do you mean to generate static HTML ?Hendekagon– Hendekagon2013-02-13 23:16:12 +00:00Commented Feb 13, 2013 at 23:16
-
could you describe some example input/code and what the expected result would be?Arthur Ulfeldt– Arthur Ulfeldt2013-02-13 23:20:34 +00:00Commented Feb 13, 2013 at 23:20
-
I really like how I can use clojure and Noir to create a website (still learning), but I was wondering if there is a way not to use .war files, so that any server will understand the regular html, css and javascript.Danny Watts– Danny Watts2013-02-14 16:55:14 +00:00Commented Feb 14, 2013 at 16:55
2 Answers
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.
2 Comments
If you want to create a static site, there are couple of options,