Fork me on GitHub

Kind of compilers

Now, there are 3 official compiler.

  • default
  • clostache
  • copy
  • cljs

Default compiler

Explained in this document. S-expression to HTML compiler.

Clostache compiler

HTML to HTML compiler using clostache. If you are poor at S-exp, clostache compiler is good choice.
Clostache compiler is maintained at misaki-clostache,

Copy compiler

File copying compiler. If you want to copy template file without changes, use this compiler. Target template extension is *(all extensions).

Copy compiler has custom option named :except-extensions. If you specify this option in _config.clj, copy compiler except files which has specified extension.

{
 ; other settings...

 ; excepting extensions
 ; (setting for copy compiler)
 :except-extensions [:jpg :png :gif]
 }

Cljs compiler

ClojureScript compiler. clj file compiles to js. Detailed explanation is here.

Switch compiler

Edit :compiler setting in _config.clj

{
 ; other settings...

 ; compiler setting
 :compiler "default"
 }

Use misaki-clostache

Add misaki-clostache dependency.

{
 :dependencies [
    ; other dependencies
    [misaki-clostache "0.0.1-alpha"]] ; add misaki-clostache

 ; set clostache as compiler
 :compiler "clostache"
 }
$ lein deps
$ lein run YOUR_SITE

Use multiple compilers

You can use multiple compilers at the same time.

{
 ; other settings...

 ; multiple compiler setting
 :compiler ["default" "copy"]
 }

In this case, default compiler is called at first. If default compiler returns success result, compiling template is finished. If default compiler skip to compile the template, copy compiler is call.

See also..

« Clojurescript  |  Top Page  |  Develop Compiler »