Skip to content
Browse files

Change site-routes layout to keyword

  • Loading branch information...
swlkr committed Mar 15, 2019
1 parent 5a038a7 commit fe3b9f171855cb687b043c5fa56f83a7ab64270f
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/coast/middleware.clj
@@ -159,7 +159,8 @@
(if (nil? layout)
(fn [request]
(let [response (handler request)]
(let [layout (-> layout utils/keyword->symbol resolve)
response (handler request)]
(map? response) response
(layout? response layout) (-> (layout request response)
@@ -186,13 +187,13 @@

(defn site-routes [& args]
(let [[layout routes] (if (fn? (first args))
[(first args) (rest args)]
[nil args])]
(let [[layout-kw routes] (if (keyword? (first args))
[(first args) (rest args)]
[nil args])]
(router/wrap-routes #(wrap-site-errors % routes)
#(wrap-not-found % routes)
#(wrap-layout % layout)
#(wrap-layout % layout-kw)

(defn coerce-params [val]

0 comments on commit fe3b9f1

Please sign in to comment.
You can’t perform that action at this time.