Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

wrong scope in layout

  • Loading branch information...
commit b11b6cd5cc5a4466f0b6c55bcdcbdac81aa0b10e 1 parent 37c5b47
Marko Mikulicic authored

Showing 1 changed file with 9 additions and 5 deletions. Show diff stats Hide diff stats

  1. +9 5 src/haml_macro/core.clj
14 src/haml_macro/core.clj
@@ -166,16 +166,20 @@
166 166 (defn layout-path []
167 167 (str "layouts/" "application"))
168 168
  169 +(def *layout-path*
  170 + "layouts/application")
  171 +
169 172 (defn build-layout [l]
170   - (list 'fn ['yield] (apply list 'list l)))
  173 + ;(list 'fn ['yield] (apply list 'list l)))
  174 + (apply list 'list l))
171 175
172 176 (defn load-layout []
173   - (let [lp (layout-path)]
  177 + (let [lp *layout-path*]
174 178 (build-layout (if (.exists (java.io.File. (str @*templates-dir* "/" lp ".haml")))
175 179 (haml-file lp)
176 180 '(yield)))))
177 181
178 182 (defn haml-file-with-layout [file]
179   - ((eval (load-layout)) (apply list 'list (haml-file file))))
180   -
181   -
  183 + (let [loaded-layout (load-layout)
  184 + body (apply list 'list (haml-file file))]
  185 + [(list 'let ['yield body] loaded-layout)]))

0 comments on commit b11b6cd

Please sign in to comment.
Something went wrong with that request. Please try again.