diff --git a/resources/co/gaiwan/compass/dev.edn b/resources/co/gaiwan/compass/dev.edn index e737f5f..87d81ff 100644 --- a/resources/co/gaiwan/compass/dev.edn +++ b/resources/co/gaiwan/compass/dev.edn @@ -1,3 +1,4 @@ {:compass/origin "http://localhost:8099" :datomic/url "datomic:mem://compass" - :http/show-exception-details? true} + :http/show-exception-details? true + :live.js? true} diff --git a/src/co/gaiwan/compass/html/layout.clj b/src/co/gaiwan/compass/html/layout.clj index fc9f169..272a4d6 100644 --- a/src/co/gaiwan/compass/html/layout.clj +++ b/src/co/gaiwan/compass/html/layout.clj @@ -1,9 +1,10 @@ (ns co.gaiwan.compass.html.layout (:require - [ring.middleware.anti-forgery :as anti-forgery] [charred.api :as charred] + [co.gaiwan.compass.config :as config] [co.gaiwan.compass.html.navigation :as nav] - [lambdaisland.ornament :as o])) + [lambdaisland.ornament :as o] + [ring.middleware.anti-forgery :as anti-forgery])) (o/defrules layout [:body @@ -11,6 +12,8 @@ [:#app {:max-width "80rem" :margin "0 auto"} [:>main :p-2]]]) +(def start-time (System/currentTimeMillis)) + (defn base-layout [{:keys [head body flash user request] :as opts}] [:html [:head @@ -20,10 +23,11 @@ [:link {:rel "stylesheet" :href "/css/open-props.min.css"}] [:link {:rel "stylesheet" :href "/css/open-props-normalize.min.css"}] [:link {:rel "stylesheet" :href "/css/buttons.css"}] - [:link {:rel "stylesheet" :href "/css/styles.css"}] + [:link {:rel "stylesheet" :href (str "/css/styles.css?t=" start-time)}] [:script {:src "/js/htmx-1.9.12.js"}] [:script {:src "/js/cx.js"}] - [:script {:src "/js/live.js#css"}] + (when (config/value :live.js?) + [:script {:src "/js/live.js#css"}]) [:script {:src "/js/html-duration-picker.min.js"}] head] [:body {;; Have HTMX handle normal links