   [path]
   (-> path (relative-path) (strip-extensions) (str ".html")))
 
-(defn canonical-url
-  "Given some url, ensures that it is an absolute url. If url is a path to
-  some index.html, return a url to the parent directory."
-  [url]
-  (str "/" (-> url (clojure.string/replace "index.html" "") (strip-extensions))))
-
 (defn file-mapping
   [info root file]
   (let [path (.getPath file)]

  [mapping]
  (reduce (fn [site [path inf]]
            (assoc-in site
                      (resource-key (:url inf))
                      (update-in inf [:url] canonical-url)))
          {}
          mapping))

                  writer (html-writer build-root url)]
        (f (assoc site
                  :current-page
                  (get-in site (site-nav url)))
           reader
           writer)))))
      
