 
 (defn compile-file!
   [site-map build-root [page-record lines]]
-  (let [output (mk-output build-root (:path page-record))]
+  (let [output (build-path build-root (:path page-record))]
     (with-parent-dir output
       (fn []
         (with-open [writer (clojure.java.io/writer output)]

            [hiccup.core :as hiccup]
            [me.raynes.fs :as fs]))

(def ^:dynamic *site-map*
  "This contain the hash created by recursively reading metadata from content files
  in the build directory."
  
  nil)

(def ^:dynamic site nil)

(def ^:dynamic *meta-sep*
  "The separator that splits each content file into meta and content sections."
  "===")

(def ^:dynamic *block-sep*
  "Separator used in content files to denote line-oriented preprocessing
  blocks."
  "$$$")

(def content-file? (complement fs/directory?))


    [:head [:title (:title page-record)]]
    [:body (md-to-html-string (join "\n" content-lines))]]))

(defn build-path
  [root path]
  (clojure.java.io/as-file
   (str (join "/" (cons root (drop 2 (fs/split (strip-extension path)))))
