diff --git a/src/scicloj/clay/v2/server.clj b/src/scicloj/clay/v2/server.clj index 200b6d35..518a0b0b 100644 --- a/src/scicloj/clay/v2/server.clj +++ b/src/scicloj/clay/v2/server.clj @@ -39,60 +39,41 @@ (defn communication-script "The communication JS script to init a WebSocket to the server." [{:keys [port counter]}] - (let [reload-regexp ".*/(#[a-zA-Z\\-]+)?\\$" - ;; We use this regexp to recognize when to used - ;; page reload rather than revert to the original URL, - ;; see below. - ] - (->> [port counter reload-regexp] - (apply format " + (->> [port counter] + (apply format " ")))) +"))) (defn header [state] (hiccup/html @@ -300,7 +281,8 @@ (assoc :full-target-path full-target-path) (server.state/reset-last-rendered-spec!)) (when show - (broadcast! "refresh")) + (let [path (fs/unixify (fs/relativize base-target-path full-target-path))] + (broadcast! (str "refresh /" path)))) [:ok]) (defn loading! []