Skip to content

Commit

Permalink
Cache bust ornament css, disable live.js on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
plexus committed Aug 14, 2024
1 parent 9c5e21d commit 145f8c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion resources/co/gaiwan/compass/dev.edn
Original file line number Diff line number Diff line change
@@ -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}
12 changes: 8 additions & 4 deletions src/co/gaiwan/compass/html/layout.clj
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
(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
{:max-width "100vw"}
[:#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
Expand All @@ -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
Expand Down

0 comments on commit 145f8c5

Please sign in to comment.