     [:head [:title (:title page-record)]]
     [:body (md-to-html-string (join "\n" content-lines))]]))
 
-(defn mk-output
+(defn build-path
   [root path]
   (clojure.java.io/as-file
    (str (join "/" (cons root (drop 2 (fs/split (strip-extension path)))))

  [root-dir]
  (map-directory! build-file! content-file? root-dir))

;; A site is our primary way of keeping track of content files as they
;; change.

(defn conj-site-map
  [site-map page-record]
  (assoc-in site-map
            (map keyword (fs/split (:path page-record)))
            page-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))]
            (get (reduce #(conj-site-map %1 (first %2))
                         {}
                         (build-files! root-dir))
                 (keyword root-part)))))


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