add strict-mode option support

This commit is contained in:
Gered 2014-06-19 18:11:39 -04:00
parent 68c2beb863
commit 77a10a38d7
2 changed files with 11 additions and 3 deletions

View file

@ -24,10 +24,15 @@
see clj-jtwig.options for the option keys you can specify here."
[& opts]
(doseq [[k v] (apply hash-map opts)]
(if (= :cache-compiled-templates k)
(cond
(= k :cache-compiled-templates)
; always clear the cache when toggling. this will help ensure that any possiblity of weird behaviour from
; leftover stuff being stuck in the cache pre-toggle-on/off won't happen
(flush-template-cache!))
(flush-template-cache!)
(= k :strict-mode)
(-> configuration .parse (.strictMode v)))
(swap! options assoc k v)))
; cache of compiled templates. key is the file path. value is a map with :last-modified which is the source file's

View file

@ -41,4 +41,7 @@
; the root path (relative to the classpath) where web resources such as js, css, images are
; located. typically in your project structure this path will be located under the
; "resources" directory.
:web-resource-path-root "public"}))
:web-resource-path-root "public"
; when enabled, exceptions will be thrown when attempting to use variables that do not exist
:strict-mode false}))