diff --git a/src/clj_jtwig/web/web_functions.clj b/src/clj_jtwig/web/web_functions.clj new file mode 100644 index 0000000..77d8ecb --- /dev/null +++ b/src/clj_jtwig/web/web_functions.clj @@ -0,0 +1,12 @@ +(ns clj-jtwig.web.web-functions + "web functions, intended to be used by web applications only. most of these will require the + current servlet context path, so use of clj-jtwig.web.middleware.wrap-servlet-context-path + is a prerequisite for these functions." + (:require [clj-jtwig.web.middleware :refer [*servlet-context-path*]])) + +; defined using the same type of map structure as in clj-jtwig.standard-functions + +(defonce web-functions + {"path" + {:fn (fn [url] + (str *servlet-context-path* url))}})