From 0bf35cfa1d8202742351861c5706c19ab692bfc8 Mon Sep 17 00:00:00 2001 From: Marko Mikulicic Date: Mon, 29 Mar 2010 12:12:29 +0200 Subject: [PATCH] use 'views' as standard dir --- README.md | 4 +++- src/haml_macro/core.clj | 2 +- {pages => views}/example.haml | 0 3 files changed, 4 insertions(+), 2 deletions(-) rename {pages => views}/example.haml (100%) diff --git a/README.md b/README.md index 61167af..6194df7 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,11 @@ USAGE: (defroutes greeter (GET "/hello/:first/:last" (haml "example.haml"))) -see example.haml +see views/example.haml +you can change the directory where the templates are searched with: + (set-template-dir "somepath") haml is compiled to clojure code, you need to reload your module from REPL to see your changes in HAML. diff --git a/src/haml_macro/core.clj b/src/haml_macro/core.clj index 1d5dfa3..7d76fce 100644 --- a/src/haml_macro/core.clj +++ b/src/haml_macro/core.clj @@ -82,7 +82,7 @@ (defn haml-str [strn] (:value (parse source strn))) -(def *templates-dir* (atom ".")) +(def *templates-dir* (atom "views")) (defn haml-file [file] (haml-str (slurp (str @*templates-dir* "/" file)))) diff --git a/pages/example.haml b/views/example.haml similarity index 100% rename from pages/example.haml rename to views/example.haml