                         (join "/" (concat (fs/split root-dir)
                                           (list "content"))))]
       (build-site-map! content-root)
-      (compile-content! content-root build-root))))
+      (compile-content! @*site-map* content-root build-root))))

;; change.

(defn conj-site-map
  [site-map file-record]
  (assoc-in site-map
            (map keyword (fs/split (:path file-record)))
            file-record))

(defn build-site-map!
  "Creates a nested persistent map where the keys are filenames and directory
  names, and entries are maps of the same type, or file records."
  
  [root-dir]
  (reset! *site-map*
          (let [root-part (first (fs/split root-dir))]

  (if-let [e (fs/extension s)] (clojure.string/replace s e "") s))

(defn strip-file-info
  [page-record]
  (dissoc page-record :path :mod-time))

(defn humane-site-map
  [site-map]
  (clojure.walk/postwalk (fn [form]
                           (cond (page-record? form)
                                 (strip-file-info form)
                                 
                                 (keyword? form)
                                 (-> form name strip-extension keyword)

                                 :default form))
                         site-map))

(defmulti render-file
  "Takes as its first argument a map of the type returned by `build-file!`,
  and as its second argument a lazy sequence of the lines of the corresponding
  file. Should return a string which will be written to the output file."
  (comp fs/extension :path))

(defmethod render-file ".md"
  [page-record content-lines]
  (hiccup/html
   [:html
    [:head [:title (:title page-record)]]
    [:body (md-to-html-string (join "\n" content-lines))]]))

(defn mk-output
