From b63393988361e0074228ae543f86e74f6b0407b8 Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 1 Jun 2014 17:06:35 -0400 Subject: [PATCH] move this out to a separate def for now, will add as an option later --- src/clj_jtwig/web/web_functions.clj | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/clj_jtwig/web/web_functions.clj b/src/clj_jtwig/web/web_functions.clj index 0f65e24..8e01b67 100644 --- a/src/clj_jtwig/web/web_functions.clj +++ b/src/clj_jtwig/web/web_functions.clj @@ -5,7 +5,12 @@ (:import (java.net URI)) (:require [clj-jtwig.web.middleware :refer [*servlet-context-path*]] [clojure.string :as str]) - (:use [clj-jtwig.utils])) + (:use [clj-jtwig.utils] + [clj-jtwig.options])) + +;; TODO: while 'public' is the default with Compojure, applications can override with something else ... +;; should make this customizable (some option added to clj-jtwig.options likely ...) +(def root-resource-path "public") (defn- get-context-url [url] (str *servlet-context-path* url)) @@ -17,8 +22,8 @@ (defn- get-resource-modification-timestamp [^String resource-url] (if (relative-url? resource-url) - ;; TODO: while 'public' is the default with Compojure, applications can override with something else ... - (->> (str "public" resource-url) + + (->> (str root-resource-path resource-url) (get-context-url) (get-resource-modification-date))))